-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (41 loc) · 1.2 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: automatic update
on:
workflow_dispatch:
push:
branches:
- master
jobs:
skip:
runs-on: ubuntu-latest
steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
release:
name: release
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
- name: Generate files by openapi-generator
run: sh ./generate.sh
- name: Check diff
run: |
git add .
DIFFS=`git diff --name-only HEAD`
echo $DIFFS
if [ "$DIFFS" = '' ]; then
echo "HAS_DIFF=false" >> $GITHUB_ENV
else
echo "HAS_DIFF=true" >> $GITHUB_ENV
fi
git reset HEAD
- name: git commit and push
if: env.HAS_DIFF == 'true'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "CI: regenerate [ci skip]" --author="ras0q <[email protected]>"
git push origin master