-
Notifications
You must be signed in to change notification settings - Fork 190
40 lines (39 loc) · 1.25 KB
/
sync-api-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
name: Synchronize API Docs
on:
workflow_dispatch:
schedule:
- cron: '0 * * * 1-5' # Mon-Fri every hour
push:
branches: [chore/docs-action]
jobs:
build:
name: synchronize-api-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache-dependency-path: |
tools/api-docs-generator/go.sum
- name: generate
id: generate
working-directory: ./tools/api-docs-generator
run: |
make run | tee /tmp/run.log
result_code=${PIPESTATUS[0]}
echo 'MENU<<EOF' >> $GITHUB_OUTPUT
cat /tmp/run.log >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
exit $result_code
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: synchronizing api spec with user-docs"
title: "Generate API docs from spec"
body: |
This PR was automatically generated by the API docs synchronization action. Please review the changes and merge if they look good.
```
${{ steps.generate.outputs.MENU }}
```
branch: docs/automatic-api-docs-update
base: main