openapi.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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_MINS: 3
  9. jobs:
  10. build_and_deref_json:
  11. runs-on: ubuntu-24.04
  12. timeout-minutes: 90
  13. steps:
  14. - name: Getsentry Token
  15. id: getsentry
  16. uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc # v3.0.0
  17. with:
  18. app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
  19. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  20. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  21. - name: Check for python file changes
  22. uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
  23. id: changes
  24. with:
  25. token: ${{ github.token }}
  26. filters: .github/file-filters.yml
  27. - name: Setup sentry env
  28. uses: ./.github/actions/setup-sentry
  29. with:
  30. use-new-devservices: true
  31. mode: migrations
  32. if: steps.changes.outputs.api_docs == 'true'
  33. - name: Checkout getsentry/sentry-api-schema
  34. if: steps.changes.outputs.api_docs == 'true'
  35. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  36. with:
  37. ref: 'main'
  38. repository: getsentry/sentry-api-schema
  39. path: sentry-api-schema
  40. token: ${{ steps.getsentry.outputs.token }}
  41. - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
  42. if: steps.changes.outputs.api_docs == 'true'
  43. id: setup-node
  44. with:
  45. node-version-file: '.volta.json'
  46. - name: Build OpenAPI Derefed JSON
  47. if: steps.changes.outputs.api_docs == 'true'
  48. # install ts-node for ts build scripts to execute properly without potentially installing
  49. # conflicting deps when running scripts locally
  50. # see: https://github.com/getsentry/sentry/pull/32328/files
  51. run: |
  52. yarn add ts-node && make build-api-docs
  53. - name: Build RPC method schema
  54. if: steps.changes.outputs.api_docs == 'true'
  55. run: |
  56. sentry rpcschema > rpc_method_schema.json
  57. - name: Copy artifacts into getsentry/sentry-api-schema
  58. if: steps.changes.outputs.api_docs == 'true'
  59. run: |
  60. cp tests/apidocs/openapi-derefed.json sentry-api-schema
  61. cp src/sentry/apidocs/api_ownership_stats_dont_modify.json sentry-api-schema
  62. cp rpc_method_schema.json sentry-api-schema
  63. - name: Git Commit & Push
  64. uses: stefanzweifel/git-auto-commit-action@0049e3fa4059ca715255fbbcb7dea4516f02ce0a # v4.15.3
  65. if: steps.changes.outputs.api_docs == 'true'
  66. with:
  67. repository: sentry-api-schema
  68. branch: main
  69. commit_message: Generated
  70. commit_user_email: bot@getsentry.com
  71. commit_user_name: openapi-getsentry-bot