Repository navigation
update CI configuration to use actions/checkout@v5 for linting and bu… #16
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Lint OpenAPI spec | |
| run: npx @redocly/cli lint ./openapi/openapi.yaml | |
| bundle: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Bundle OpenAPI spec | |
| run: npx @redocly/cli bundle ./openapi/openapi.yaml -o ./dist/openapi.yaml | |
| - name: Check for changes | |
| id: diff | |
| run: | | |
| git diff --quiet dist/openapi.yaml && echo "changed=false" >> "$GITHUB_OUTPUT" || echo "changed=true" >> "$GITHUB_OUTPUT" | |
| - name: Commit bundled spec | |
| if: steps.diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add dist/openapi.yaml | |
| git commit -m "Update bundled OpenAPI spec" | |
| git push |