Skip to content

Commit

Permalink
Set title and description written in line-openapi PR again (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 authored Jan 15, 2025
1 parent 8b47460 commit c902425
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/diff-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ jobs:
## Run if diff exists and event is not pull request, and make PR
- if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
run: |
# Determine Change Type via Submodule Script. This scripts read current uncommited changes.
CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs)
echo "Determined change type: $CHANGE_TYPE"
# Determine PR title and body
if [ "$CHANGE_TYPE" == "submodule-update" ]; then
# Fetch PR info from submodule
npx zx ./line-openapi/tools/get-pr-info.mjs
PR_INFO=$(cat pr_info.json)
TITLE=$(echo "$PR_INFO" | jq -r '.title')
BODY=$(echo "$PR_INFO" | jq -r '.url')$'\n\n'$(echo "$PR_INFO" | jq -r '.body')
else
# Default PR title and body
TITLE="Codes are generated by openapi generator"
BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
fi
# Create PR
BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
git config user.name github-actions
Expand All @@ -81,19 +99,6 @@ jobs:
git commit --allow-empty -m "Update document"
git push origin $BRANCH_NAME
# Determine PR title and body
if [ "$CHANGE_TYPE" == "submodule-update" ]; then
# Fetch PR info from submodule
npx zx ./line-openapi/tools/get-pr-info.mjs
PR_INFO=$(cat pr_info.json)
TITLE=$(echo "$PR_INFO" | jq -r '.title')
BODY=$(echo "$PR_INFO" | jq -r '.url')$'\n\n'$(echo "$PR_INFO" | jq -r '.body')
else
# Default PR title and body
TITLE="Codes are generated by openapi generator"
BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
fi
gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update"
env:
Expand Down

0 comments on commit c902425

Please sign in to comment.