24
24
distribution : ' temurin'
25
25
java-version : 17
26
26
architecture : x64
27
+ - uses : actions/setup-node@v4
27
28
- name : Generate code
28
29
run : |
29
30
python generate-code.py
@@ -39,14 +40,30 @@ jobs:
39
40
# # Run if diff exists and event is not pull request, and make PR
40
41
- if : ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
41
42
run : |
43
+ BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
44
+
42
45
git config user.name github-actions
43
46
git config user.email github-actions@github.com
44
- git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
47
+ git checkout -b $BRANCH_NAME
45
48
46
49
git add .
47
50
git commit -m "Code are generated by openapi generator"
48
- git push origin update-diff-${{ env.CURRENT_DATETIME }}
49
51
50
- gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi generator" -b "" --label "line-openapi-update"
52
+ git push origin $BRANCH_NAME
53
+
54
+ # Determine PR title and body
55
+ if [ "$CHANGE_TYPE" == "submodule-update" ]; then
56
+ # Fetch PR info from submodule
57
+ npx zx ./line-openapi/tools/get-pr-info.mjs
58
+ PR_INFO=$(cat pr_info.json)
59
+ TITLE=$(echo "$PR_INFO" | jq -r '.title')
60
+ BODY=$(echo "$PR_INFO" | jq -r '.url')$'\n\n'$(echo "$PR_INFO" | jq -r '.body')
61
+ else
62
+ # Default PR title and body
63
+ TITLE="Codes are generated by openapi generator"
64
+ BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
65
+ fi
66
+
67
+ gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update"
51
68
env :
52
69
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments