getsentry-dispatch.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Dispatch a request to getsentry to run getsentry test suites
  2. name: getsentry dispatcher
  3. on:
  4. # XXX: We are using `pull_request_target` instead of `pull_request` because we want
  5. # this to run on forks. It allows forks to access secrets safely by
  6. # only running workflows from the main branch. Prefer to use `pull_request` when possible.
  7. #
  8. # See https://github.com/getsentry/sentry/pull/21600 for more details
  9. pull_request_target:
  10. jobs:
  11. dispatch:
  12. name: getsentry dispatch
  13. runs-on: ubuntu-18.04
  14. steps:
  15. # Need to checkout just for `github/file-filters.yml`
  16. - uses: actions/checkout@v2
  17. - name: Check for file changes
  18. uses: getsentry/paths-filter@v2
  19. id: changes
  20. with:
  21. token: ${{ github.token }}
  22. filters: .github/file-filters.yml
  23. - name: getsentry token
  24. uses: getsentry/action-github-app-token@v1
  25. id: getsentry
  26. with:
  27. app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
  28. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  29. - name: Dispatch getsentry tests
  30. uses: actions/github-script@v3
  31. with:
  32. github-token: ${{ steps.getsentry.outputs.token }}
  33. script: |
  34. require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/getsentry-dispatch`).dispatch({
  35. github,
  36. context,
  37. fileChanges: ${{ toJson(steps.changes.outputs) }}
  38. });