name: openapi-diff on: pull_request: jobs: check-diff: name: build api runs-on: ubuntu-20.04 timeout-minutes: 90 steps: - uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 with: # Avoid codecov error message related to SHA resolution: # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891 fetch-depth: '2' - name: Check for python file changes uses: getsentry/paths-filter@66f7f1844185eb7fb6738ea4ea59d74bb99199e5 # v2 id: changes with: token: ${{ github.token }} filters: .github/file-filters.yml - name: Setup sentry env uses: ./.github/actions/setup-sentry if: steps.changes.outputs.api_docs == 'true' id: setup - name: Checkout getsentry/sentry-api-schema uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 if: steps.changes.outputs.api_docs == 'true' with: ref: 'main' repository: getsentry/sentry-api-schema path: sentry-api-schema - uses: ./.github/actions/setup-volta if: steps.changes.outputs.api_docs == 'true' - name: Build OpenAPI Derefed JSON if: steps.changes.outputs.api_docs == 'true' # install ts-node for ts build scripts to execute properly without potentially installing # conflicting deps when running scripts locally # see: https://github.com/getsentry/sentry/pull/32328/files run: | yarn add ts-node && make build-api-docs - name: Compare OpenAPI Derefed JSON if: steps.changes.outputs.api_docs == 'true' run: | npx json-diff@0.5.4 --color sentry-api-schema/openapi-derefed.json tests/apidocs/openapi-derefed.json