File tree Expand file tree Collapse file tree 2 files changed +35
-35
lines changed Expand file tree Collapse file tree 2 files changed +35
-35
lines changed Original file line number Diff line number Diff line change 1+ name : Commit generated code to master branch
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - master
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Setup
15+ uses : actions/checkout@v4
16+ with :
17+ submodules : recursive
18+ - name : Set up Python
19+ uses : actions/setup-python@v4
20+ with :
21+ python-version : ' 3.x'
22+ - name : Generate code
23+ run : |
24+ python generate-code.py
25+ diff=$(git --no-pager diff --name-only HEAD)
26+ echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
27+ - if : ${{ env.DIFF_IS_EMPTY != 'true' }}
28+ run : |
29+ git config user.name github-actions
30+ git config user.email [email protected] 31+ git add .
32+ git commit -m "Code are generated by openapi generator"
33+ git push origin master
34+ env :
35+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments