openapi.yml 2.5 KB

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