File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- name : Commit generated code to master branch
1
+ name : Generate code and open pull request
2
2
3
3
on :
4
4
workflow_dispatch :
@@ -24,12 +24,15 @@ jobs:
24
24
python generate-code.py
25
25
diff=$(git --no-pager diff --name-only HEAD)
26
26
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
27
+ echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
27
28
- if : ${{ env.DIFF_IS_EMPTY != 'true' }}
28
29
run : |
29
30
git config user.name github-actions
30
31
git config user.email github-actions@github.com
32
+ git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
31
33
git add .
32
34
git commit -m "Code are generated by openapi generator"
33
- git push origin master
35
+ git push origin update-diff-${{ env.CURRENT_DATETIME }}
36
+ gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi generator" -b "" --label "line-openapi-update"
34
37
env :
35
38
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments