-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (41 loc) · 991 Bytes
/
generate.yml
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
name: Generate Go SDK
on:
push:
branches-ignore:
- 'generate*'
paths:
- 'generate/**'
pull_request:
branches:
- main
paths:
- 'generate/**'
env:
GO_VERSION: 1.21
jobs:
release-go-sdk:
name: "Generate Go SDK"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Generate
run: |
cd generate
make
- name: Commit
run: |
if [[ $(git diff --exit-code client models go.mod go.sum) ]]; then
git config --global user.name 'Signadot'
git config --global user.email '[email protected]'
git add client models go.mod go.sum
git commit -m "swagger generation"
branch=generate-${{ github.sha }}
git checkout -b $branch
git push --set-upstream origin $branch
else
echo "no changes"
fi