js-getsentry-dispatch.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # If frontend files change, dispatch a request to getsentry to run its javascript 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. frontend:
  12. name: frontend dispatch
  13. runs-on: ubuntu-16.04
  14. steps:
  15. # This workflow only uses `.github/file-filters.yml`, so we do not need to checkout
  16. # the head ref from potential forked repo. Instead, we are ok with the base branch
  17. # (i.e. getsentry master)
  18. - uses: actions/checkout@v2
  19. - name: Check for frontend file changes
  20. uses: getsentry/paths-filter@v2
  21. id: changes
  22. with:
  23. token: ${{ github.token }}
  24. filters: .github/file-filters.yml
  25. - name: getsentry token
  26. uses: getsentry/action-github-app-token@v1
  27. id: getsentry
  28. with:
  29. app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
  30. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  31. # Notify getsentry only if there were frontend files changed
  32. - name: Dispatch getsentry frontend tests
  33. uses: actions/github-script@v3
  34. with:
  35. github-token: ${{ steps.getsentry.outputs.token }}
  36. script: |
  37. github.actions.createWorkflowDispatch({
  38. owner: 'getsentry',
  39. repo: 'getsentry',
  40. workflow_id: 'js-build-and-lint.yml',
  41. ref: 'master',
  42. inputs: {
  43. 'skip': "${{ steps.changes.outputs.frontend != 'true' }}",
  44. 'sentry-sha': '${{ github.event.pull_request.head.sha }}',
  45. }
  46. })