-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (48 loc) · 1.38 KB
/
api-update-docs.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
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: api-docs
jobs:
api_changes:
runs-on: [ARM64, self-hosted, Linux]
permissions:
pull-requests: read
outputs:
run_api_ci: ${{ steps.filter.outputs.dependencies }}
steps:
- name: Check for changed files
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dependencies:
- '.github/**'
- 'api/**'
- 'shared/**'
update-api-docs:
needs: api_changes
if: ${{ needs.api_changes.outputs.run_api_ci == 'true' }}
runs-on: [ARM64, self-hosted, Linux]
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.CZI_GITHUB_HELPER_APP_ID }}
private_key: ${{ secrets.CZI_GITHUB_HELPER_PK }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-go@v4
with:
go-version-file: api/go.mod
cache: true
- run: go install github.com/swaggo/swag/cmd/[email protected]
- run: cd api && make update-docs
- uses: EndBug/add-and-commit@v9
with:
add: -A
message: ci - update and format swagger docs