feat: auto-generate OpenAPI spec for miner HTTP endpoints #2
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 Sync Check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| check-openapi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Generate OpenAPI spec | |
| run: | | |
| python scripts/generate_openapi.py | |
| - name: Check for unstaged changes | |
| run: | | |
| if [[ -n "$(git status --porcelain docs/openapi.json)" ]]; then | |
| echo "::error::docs/openapi.json is out of sync with code! Please run 'python scripts/generate_openapi.py' locally and commit the changes." | |
| git diff docs/openapi.json | |
| exit 1 | |
| fi |