Sync OpenAPI #70
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: Sync OpenAPI | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fetch latest OpenAPI spec | |
| run: | | |
| curl -sSL -o openapi/openapi.json \ | |
| https://raw.githubusercontent.com/everruns/everruns/main/docs/api/openapi.json | |
| - name: Check for changes | |
| id: diff | |
| run: | | |
| if git diff --quiet openapi/; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Regenerate SDK types | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| echo "TODO: Run type generation" | |
| - name: Create PR | |
| if: steps.diff.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| title: "chore: sync OpenAPI spec" | |
| branch: chore/sync-openapi | |
| body: | | |
| Auto-generated PR to sync OpenAPI spec changes from main repo. |