openapi.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. strategy:
  11. matrix:
  12. python-version: [3.8.12]
  13. steps:
  14. - name: Getsentry Token
  15. id: getsentry
  16. uses: getsentry/action-github-app-token@v1
  17. with:
  18. app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
  19. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  20. - uses: actions/checkout@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@v2
  27. id: changes
  28. with:
  29. token: ${{ github.token }}
  30. filters: .github/file-filters.yml
  31. - name: Setup sentry env (python ${{ matrix.python-version }})
  32. uses: ./.github/actions/setup-sentry
  33. if: steps.changes.outputs.api_docs == 'true'
  34. id: setup
  35. with:
  36. python-version: ${{ matrix.python-version }}
  37. pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }}
  38. - name: Checkout getsentry/sentry-api-schema
  39. if: steps.changes.outputs.api_docs == 'true'
  40. uses: actions/checkout@v2
  41. with:
  42. ref: 'main'
  43. repository: getsentry/sentry-api-schema
  44. path: sentry-api-schema
  45. token: ${{ steps.getsentry.outputs.token }}
  46. - name: Install/setup node
  47. if: steps.changes.outputs.api_docs == 'true'
  48. uses: volta-cli/action@v1
  49. - name: Build OpenAPI Derefed JSON
  50. if: steps.changes.outputs.api_docs == 'true'
  51. run: |
  52. make build-api-docs
  53. - name: Copy artifact into getsentry/sentry-api-schema
  54. if: steps.changes.outputs.api_docs == 'true'
  55. run: |
  56. cp tests/apidocs/openapi-derefed.json sentry-api-schema
  57. - name: Git Commit & Push
  58. uses: stefanzweifel/git-auto-commit-action@5804e42f86b1891093b151b6c4e78e759c746c4d
  59. if: steps.changes.outputs.api_docs == 'true'
  60. with:
  61. repository: sentry-api-schema
  62. branch: main
  63. commit_message: Generated
  64. commit_user_email: bot@getsentry.com
  65. commit_user_name: openapi-getsentry-bot