ci(openapi): enforce info.version bump on spec changes + version sidecar #1
Workflow file for this run
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: OpenAPI Version Check | |
| on: | |
| pull_request: | |
| paths: | |
| - public/openapi.json | |
| - CHANGELOG.md | |
| - scripts/check-openapi-version.mjs | |
| - .github/workflows/openapi-version-check.yml | |
| permissions: | |
| contents: read | |
| jobs: | |
| openapi-version: | |
| name: OpenAPI version bump | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '22' | |
| - name: Load base OpenAPI spec | |
| run: | | |
| git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" | |
| git show "origin/${{ github.base_ref }}:public/openapi.json" > /tmp/openapi.base.json || echo '{}' > /tmp/openapi.base.json | |
| - name: Check OpenAPI version policy | |
| run: node scripts/check-openapi-version.mjs /tmp/openapi.base.json public/openapi.json |