-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 2.4 KB
/
build-sdk.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build SDK
on:
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Merge the OpenAPI Specs
run: |
chmod +x merge.sh # Make the script executable
./merge.sh
continue-on-error: false # Stop the workflow if merge.sh returns a non-zero exit code
- name: Build SDK from OpenApi Spec
run: |
chmod +x build-sdk.sh # Make the script executable
./build-sdk.sh
continue-on-error: false # Stop the workflow if build-sdk.sh returns a non-zero exit code
- name: Swith to publish .gitignore
run: |
cp .gitignore .gitignore.local
cp .gitignore.pub .gitignore
continue-on-error: false
- name: Commit SDK updates
uses: EndBug/add-and-commit@v9
with:
# The arguments for the `git add` command (see the paragraph below for more info)
# Default: '.'
add: 'open-api-spec.yml guard-rails-api-client'
# The name of the user that will be displayed as the author of the commit.
# Default: depends on the default_author input
author_name: ${{ github.event.pull_request.user.login }}
# The email of the user that will be displayed as the author of the commit.
# Default: depends on the default_author input
author_email: ${{ github.event.pull_request.user.email }}
# The message for the commit.
# Default: 'Commit from GitHub Actions (name of the workflow)'
message: 'update generated sdk'
# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
# - ignore -> errors will be logged but the step won't fail
# - exitImmediately -> the action will stop right away, and the step will fail
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
# Default: ignore
pathspec_error_handling: exitAtEnd
# Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info)
# Default: true
push: true