Release 1.2.0 #7
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
| on: | |
| pull_request: | |
| name: API Spec review | |
| env: | |
| COMPOSE_USER: root | |
| jobs: | |
| api-spec: | |
| runs-on: ubuntu-latest | |
| name: API specification validation | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| # https://taskfile.dev/installation/#github-actions | |
| - uses: go-task/setup-task@v1 | |
| - run: | | |
| docker network create frontend | |
| task --yes site:update | |
| - name: Export API specification | |
| run: | | |
| task --yes api:spec:export | |
| - name: Check for changes in specification | |
| run: git diff --diff-filter=ACMRT --exit-code public/spec.yaml | |
| detect-breaking-changes: | |
| runs-on: ubuntu-latest | |
| needs: [api-spec] | |
| steps: | |
| - name: Check out BASE rev | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.base_ref }} | |
| path: base | |
| - name: Check out HEAD rev | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| path: head | |
| - name: Run OpenAPI Diff (from HEAD rev) | |
| id: api-diff | |
| continue-on-error: true | |
| uses: docker://openapitools/openapi-diff:latest | |
| with: | |
| args: --fail-on-incompatible base/public/spec.yaml head/public/spec.yaml | |
| - name: Comment PR with API diff results | |
| if: always() | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if [ -f result.md ]; then | |
| gh pr comment ${{ github.event.pull_request.number }} --body-file result.md | |
| else | |
| if [ "${{ steps.api-diff.outcome }}" == "failure" ]; then | |
| gh pr comment ${{ github.event.pull_request.number }} --body "⚠️ **Breaking changes detected in API specification**" | |
| else | |
| gh pr comment ${{ github.event.pull_request.number }} --body "✅ **No breaking changes detected in API specification**" | |
| fi | |
| fi |