Skip to content

update CI configuration to use actions/checkout@v5 for linting and bu… #16

update CI configuration to use actions/checkout@v5 for linting and bu…

update CI configuration to use actions/checkout@v5 for linting and bu… #16

Workflow file for this run

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