-
Notifications
You must be signed in to change notification settings - Fork 101
66 lines (57 loc) · 1.89 KB
/
generate-swagger.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: "Generate Swagger Docs"
on:
pull_request:
branches: [main]
push:
branches: [spoorthi/generate-swagger-before-release]
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
proto: ${{ steps.filter.outputs.proto }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
proto:
- 'proto/**'
proto-format:
runs-on: ubuntu-latest
needs: changes
permissions:
contents: write
if: ${{ needs.changes.outputs.proto == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Format Proto Files
run: make proto-format
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Format Proto Files"
commit_options: '--no-verify'
proto-swagger:
runs-on: ubuntu-latest
needs: [changes, proto-format]
permissions:
contents: write
if: ${{ needs.changes.outputs.proto == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Generate Swagger File
run: |
git config --global --add safe.directory /workspace
make proto-swagger-gen
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Generate Swagger Docs"
commit_options: '--no-verify'