Skip to content

Commit cf2b427

Browse files
authored
Set title and description written in line-openapi PR again (#526)
same as line/line-bot-sdk-nodejs#1123
1 parent 59840be commit cf2b427

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

.github/workflows/generated-code.yml

+15-10
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,9 @@ jobs:
4747
## Run if diff exists and event is not pull request, and make PR
4848
- if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
4949
run: |
50-
BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
51-
52-
git config user.name github-actions
53-
git config user.email [email protected]
54-
git checkout -b $BRANCH_NAME
55-
56-
git add .
57-
git commit -m "Code are generated by openapi generator"
58-
59-
git push origin $BRANCH_NAME
50+
# Determine Change Type via Submodule Script. This scripts read current uncommited changes.
51+
CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs)
52+
echo "Determined change type: $CHANGE_TYPE"
6053
6154
# Determine PR title and body
6255
if [ "$CHANGE_TYPE" == "submodule-update" ]; then
@@ -71,6 +64,18 @@ jobs:
7164
BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
7265
fi
7366
67+
# Create PR
68+
BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
69+
70+
git config user.name github-actions
71+
git config user.email [email protected]
72+
git checkout -b $BRANCH_NAME
73+
74+
git add .
75+
git commit -m "Code are generated by openapi generator"
76+
77+
git push origin $BRANCH_NAME
78+
7479
gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update"
7580
env:
7681
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)