@@ -57,18 +57,34 @@ jobs:
57
57
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
58
58
- if : ${{ env.DIFF_IS_EMPTY != 'true' }}
59
59
run : |
60
+ BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}"
61
+
60
62
git config user.name github-actions
61
63
git config user.email github-actions@github.com
62
- git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
64
+ git checkout -b $BRANCH_NAME
63
65
64
66
git add line-openapi
65
67
git add src/**
66
68
git commit --allow-empty -m "Codes are generated by openapi generator"
67
69
68
70
git add docs/**
69
- git commit --allow-empty -m "Update document"
71
+ git commit --allow-empty -m "Update document"
72
+
73
+ git push origin $BRANCH_NAME
70
74
71
- git push origin update-diff-${{ env.CURRENT_DATETIME }}
72
- gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi generator" -b "" --label "line-openapi-update"
75
+ # Determine PR title and body
76
+ if [ "$CHANGE_TYPE" == "submodule-update" ]; then
77
+ # Fetch PR info from submodule
78
+ npx zx ./line-openapi/tools/get-pr-info.mjs
79
+ PR_INFO=$(cat pr_info.json)
80
+ TITLE=$(echo "$PR_INFO" | jq -r '.title')
81
+ BODY=$(echo "$PR_INFO" | jq -r '.url')$'\n\n'$(echo "$PR_INFO" | jq -r '.body')
82
+ else
83
+ # Default PR title and body
84
+ TITLE="Codes are generated by openapi generator"
85
+ BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠"
86
+ fi
87
+
88
+ gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update"
73
89
env :
74
90
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments