Skip to content

Commit aac1f21

Browse files
authored
Set title and description written in line-openapi PR again (#1523)
same as line/line-bot-sdk-nodejs#1123
1 parent fe9da5c commit aac1f21

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

.github/workflows/generate-code.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,9 @@ jobs:
4242
## Run if diff exists and event is not pull request, and make PR
4343
- if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
4444
run: |
45-
BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
46-
47-
git config user.name github-actions
48-
git config user.email github-actions@github.com
49-
git checkout -b $BRANCH_NAME
50-
51-
git add .
52-
git commit -m "Code are generated by openapi generator"
53-
54-
git push origin $BRANCH_NAME
45+
# Determine Change Type via Submodule Script. This scripts read current uncommited changes.
46+
CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs)
47+
echo "Determined change type: $CHANGE_TYPE"
5548
5649
# Determine PR title and body
5750
if [ "$CHANGE_TYPE" == "submodule-update" ]; then
@@ -66,6 +59,18 @@ jobs:
6659
BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
6760
fi
6861
62+
# Create PR
63+
BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
64+
65+
git config user.name github-actions
66+
git config user.email github-actions@github.com
67+
git checkout -b $BRANCH_NAME
68+
69+
git add .
70+
git commit -m "Code are generated by openapi generator"
71+
72+
git push origin $BRANCH_NAME
73+
6974
gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update"
7075
env:
7176
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)