-
Notifications
You must be signed in to change notification settings - Fork 38
56 lines (47 loc) · 1.37 KB
/
Copy pathgenerate-openapi-bundle.yml
File metadata and controls
56 lines (47 loc) · 1.37 KB
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
name: Generate OpenAPI Bundle
on:
push:
branches: [main]
paths:
- 'docs/openapi/**'
workflow_dispatch:
concurrency:
group: generate-openapi-bundle
cancel-in-progress: false
jobs:
bundle:
name: Bundle OpenAPI spec
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint split spec
run: bun run lint:openapi
- name: Bundle into docs/openapi.yaml
run: bun run bundle:openapi
- name: Check for changes
id: check
run: |
if git diff --quiet docs/openapi.yaml; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push bundle
if: steps.check.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/openapi.yaml
git commit --no-verify -m "chore: regenerate OpenAPI bundle"
git push