Repository navigation
63 lines (60 loc) · 2.15 KB
/
Copy pathapi-docs.yml
File metadata and controls
63 lines (60 loc) · 2.15 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
57
58
59
60
61
62
63
# API docs from code. Regenerates the pe service's OpenAPI schema and opens a
# PR when the checked-in copy drifts from what the code actually serves — so
# the documented API surface cannot silently lag behind the implementation.
name: API docs
on:
push:
branches: [staging]
paths:
- 'apps/web/src/pe/**'
- 'api-docs/**'
- 'scripts/ci/generate_pe_openapi.py'
- '.github/workflows/api-docs.yml'
schedule:
- cron: '15 4 * * 1'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
openapi-drift:
name: Regenerate pe OpenAPI spec
runs-on: ubuntu-latest
timeout-minutes: 15
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: false
- name: Init submodules
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# pe's app imports ai.research.quadit at load time.
run: bash scripts/devops/init-submodules.sh
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Regenerate api-docs/pe-openapi.json
working-directory: apps/web
env:
PYTHONPATH: '.:..'
run: uv run python ../../scripts/ci/generate_pe_openapi.py
# api-docs/ is in .prettierignore: the file is machine-generated and its
# shape belongs to the generator, not to the formatter.
- name: Verify no formatter drift
run: node scripts/ci/format-changed.mjs <(echo api-docs/pe-openapi.json)
- name: Open PR on drift
uses: peter-evans/create-pull-request@v8
with:
branch: chore/api-docs-openapi-drift
delete-branch: true
title: 'docs(api): refresh pe OpenAPI schema'
body: |
The pe service's served OpenAPI schema drifted from the
checked-in copy at `api-docs/pe-openapi.json`. This PR was
generated by the api-docs workflow — review the diff as the
authoritative API change record.
commit-message: 'docs(api): regenerate pe OpenAPI schema from code'
labels: 'documentation, api'