openapi.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: openapi
  2. on:
  3. push:
  4. branches:
  5. - master
  6. # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
  7. env:
  8. SEGMENT_DOWNLOAD_TIMEOUT_MIN: 3
  9. jobs:
  10. build_and_deref_json:
  11. runs-on: ubuntu-20.04
  12. timeout-minutes: 90
  13. steps:
  14. - name: Getsentry Token
  15. id: getsentry
  16. uses: getsentry/action-github-app-token@38a3ce582e170ddfe8789f509597c6944f2292a9 # v1
  17. with:
  18. app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
  19. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  20. - uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
  21. with:
  22. # Avoid codecov error message related to SHA resolution:
  23. # https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891
  24. fetch-depth: '2'
  25. - name: Check for python file changes
  26. uses: getsentry/paths-filter@66f7f1844185eb7fb6738ea4ea59d74bb99199e5 # v2
  27. id: changes
  28. with:
  29. token: ${{ github.token }}
  30. filters: .github/file-filters.yml
  31. - name: Setup sentry env
  32. uses: ./.github/actions/setup-sentry
  33. if: steps.changes.outputs.api_docs == 'true'
  34. id: setup
  35. - name: Checkout getsentry/sentry-api-schema
  36. if: steps.changes.outputs.api_docs == 'true'
  37. uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
  38. with:
  39. ref: 'main'
  40. repository: getsentry/sentry-api-schema
  41. path: sentry-api-schema
  42. token: ${{ steps.getsentry.outputs.token }}
  43. - uses: ./.github/actions/setup-volta
  44. if: steps.changes.outputs.api_docs == 'true'
  45. - name: Build OpenAPI Derefed JSON
  46. if: steps.changes.outputs.api_docs == 'true'
  47. # install ts-node for ts build scripts to execute properly without potentially installing
  48. # conflicting deps when running scripts locally
  49. # see: https://github.com/getsentry/sentry/pull/32328/files
  50. run: |
  51. yarn add ts-node && make build-api-docs
  52. - name: Copy artifact into getsentry/sentry-api-schema
  53. if: steps.changes.outputs.api_docs == 'true'
  54. run: |
  55. cp tests/apidocs/openapi-derefed.json sentry-api-schema
  56. - name: Git Commit & Push
  57. uses: stefanzweifel/git-auto-commit-action@5804e42f86b1891093b151b6c4e78e759c746c4d
  58. if: steps.changes.outputs.api_docs == 'true'
  59. with:
  60. repository: sentry-api-schema
  61. branch: main
  62. commit_message: Generated
  63. commit_user_email: bot@getsentry.com
  64. commit_user_name: openapi-getsentry-bot