fixes based on pr comments #2314
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
| # Copyright 2022-Present Couchbase, Inc. | |
| # | |
| # Use of this software is governed by the Business Source License included in | |
| # the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that | |
| # file, in accordance with the Business Source License, use of this software | |
| # will be governed by the Apache License, Version 2.0, included in the file | |
| # licenses/APL2.txt. | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: openapi | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| # Only run when we change an API spec | |
| paths: | |
| - 'docs/api/**' | |
| - '.redocly.yaml' | |
| - '.yamllint.yml' | |
| - '.github/workflows/openapi.yml' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| branches: | |
| - 'master' | |
| - 'main' | |
| - 'release/*' | |
| - 'feature/*' | |
| - 'beryllium' | |
| - 'CBG*' | |
| - 'ci-*' | |
| - 'api-ci-*' | |
| pull_request: | |
| # Also run on linter/config changes, so a version bump is validated before merge | |
| paths: | |
| - 'docs/api/**' | |
| - '.redocly.yaml' | |
| - '.yamllint.yml' | |
| - '.github/workflows/openapi.yml' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| branches: | |
| - 'master' | |
| - 'main' | |
| - 'release/*' | |
| - 'beryllium' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ !contains(github.ref, 'release/')}} | |
| env: | |
| # Pinned action versions, referenced by the steps below through their YAML anchors. | |
| ACTIONS_CHECKOUT_VERSION: &actions_checkout_version actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| ACTIONS_REDOCLY_PROBLEM_MATCHERS_VERSION: &actions_redocly_problem_matchers_version r7kamura/redocly-problem-matchers@3b6f82af579316596ff52f605498423b2a69e483 # v1.2.0 | |
| ACTIONS_YAMLLINT_VERSION: &actions_yamllint_version karancode/yamllint-github-action@4052d365f09b8d34eb552c363d1141fd60e2aeb2 # v3.0.0 | |
| ACTIONS_SETUP_NODE_VERSION: &actions_setup_node_version actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| jobs: | |
| api_validation: | |
| runs-on: ubuntu-latest | |
| name: OpenAPI Validation | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_node_version | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - run: npm ci | |
| - uses: *actions_redocly_problem_matchers_version | |
| - name: redocly lint | |
| run: |- | |
| npm run lint:openapi | |
| yamllint: | |
| name: 'yamllint' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_yamllint_version | |
| with: | |
| yamllint_file_or_dir: 'docs/api' |