chore: sync OpenAPI specs from semgrep.dev #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs PR check | |
| # Merge gate for docs pull requests: regenerates dynamic content so links | |
| # resolve, then runs the Mintlify link/redirect check. This does NOT commit or | |
| # open a PR — regeneration of the machine-managed files is handled on a schedule | |
| # by docs-ci.yml. This job only validates. | |
| on: | |
| pull_request: | |
| paths: | |
| - "docs/**" | |
| - "run-build-scripts" | |
| - "replace-on-build.py" | |
| - "copy-metrics-md" | |
| - "scripts/**" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docs-pr-check-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| # These scripts rewrite the API specs unattended on a schedule, so their | |
| # tests gate merges here rather than only running locally. | |
| script-tests: | |
| name: Test OpenAPI scripts | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 | |
| - name: Run unit tests | |
| run: uv run --with pyyaml --with pytest pytest scripts/tests -q | |
| # The scheduled sync re-runs both scripts after fetching, so the | |
| # checked-in specs must already be in their final shape. Otherwise the | |
| # next sync PR carries an unrelated reshuffle alongside its real changes, | |
| # which defeats reviewing that diff for dropped endpoints. | |
| - name: Check committed specs are already normalized | |
| run: | | |
| uv run scripts/mirror_openapi.py docs/public_v1.openapi.yaml docs/public_v2.openapi.yaml | |
| uv run scripts/sort_openapi_nav.py docs/public_v1.openapi.yaml docs/public_v2.openapi.yaml | |
| git diff --exit-code --stat docs/public_v1.openapi.yaml docs/public_v2.openapi.yaml | |
| validate: | |
| name: Validate docs | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| - name: Generate dynamic content | |
| run: bash run-build-scripts | |
| - name: Check links and redirects | |
| working-directory: docs | |
| # Pinned: mintlify@latest 4.2.697+ regressed and fails to parse | |
| # cheat-sheets/django-xss.mdx ("URIError: URI malformed" on the Django | |
| # {% %} template syntax), breaking this check. 4.2.696 is the last | |
| # version that parses it. Re-evaluate/bump when upstream fixes it. | |
| run: npx --yes mintlify@4.2.696 broken-links --check-redirects |