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