name: openapi on: push: branches: - master # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359 env: SEGMENT_DOWNLOAD_TIMEOUT_MIN: 3 jobs: build_and_deref_json: runs-on: ubuntu-20.04 timeout-minutes: 90 steps: - name: Getsentry Token id: getsentry uses: getsentry/action-github-app-token@38a3ce582e170ddfe8789f509597c6944f2292a9 # v1 with: app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }} private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} - 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 if: steps.changes.outputs.api_docs == 'true' uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2 with: ref: 'main' repository: getsentry/sentry-api-schema path: sentry-api-schema token: ${{ steps.getsentry.outputs.token }} - 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: Copy artifact into getsentry/sentry-api-schema if: steps.changes.outputs.api_docs == 'true' run: | cp tests/apidocs/openapi-derefed.json sentry-api-schema - name: Git Commit & Push uses: stefanzweifel/git-auto-commit-action@5804e42f86b1891093b151b6c4e78e759c746c4d 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