12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- 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-24.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- - 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- with:
- ref: 'main'
- repository: getsentry/sentry-api-schema
- path: sentry-api-schema
- token: ${{ steps.getsentry.outputs.token }}
- - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
- if: steps.changes.outputs.api_docs == 'true'
- id: setup-node
- with:
- node-version-file: '.volta.json'
- - 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
|