Skip to content

Commit 3e4fde8

Browse files
authored
Merge pull request #1099 from Yang-33/commit-generated-code
Commit generated code to master branch
2 parents c207dd8 + ca2451a commit 3e4fde8

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 }}

.github/workflows/update-git-submodule.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)