name: openapi on: push: branches: - master # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359 env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3 jobs: build_and_deref_json: runs-on: ubuntu-22.04 timeout-minutes: 90 steps: - name: Getsentry Token id: getsentry uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3.0.0 with: app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }} private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Check for python file changes uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0 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' - name: Checkout getsentry/sentry-api-schema if: steps.changes.outputs.api_docs == 'true' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: ref: 'main' repository: getsentry/sentry-api-schema path: sentry-api-schema token: ${{ steps.getsentry.outputs.token }} - uses: getsentry/action-setup-volta@e4939d337b83760d13a9d7030a6f68c9d0ee7581 # v2.0.0 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: Build RPC method schema if: steps.changes.outputs.api_docs == 'true' run: | sentry rpcschema > rpc_method_schema.json - name: Copy artifacts into getsentry/sentry-api-schema if: steps.changes.outputs.api_docs == 'true' run: | cp tests/apidocs/openapi-derefed.json sentry-api-schema cp src/sentry/apidocs/api_ownership_stats_dont_modify.json sentry-api-schema cp rpc_method_schema.json sentry-api-schema - name: Git Commit & Push uses: stefanzweifel/git-auto-commit-action@0049e3fa4059ca715255fbbcb7dea4516f02ce0a # v4.15.3 if: steps.changes.outputs.api_docs == 'true' with: repository: sentry-api-schema branch: main commit_message: Generated commit_user_email: bot@getsentry.com commit_user_name: openapi-getsentry-bot