# If frontend files change, dispatch a request to getsentry to run its javascript test suites name: getsentry dispatcher on: # XXX: We are using `pull_request_target` instead of `pull_request` because we want # this to run on forks. It allows forks to access secrets safely by # only running workflows from the main branch. Prefer to use `pull_request` when possible. # # See https://github.com/getsentry/sentry/pull/21600 for more details pull_request_target: jobs: frontend: name: frontend dispatch runs-on: ubuntu-16.04 steps: # This workflow only uses `.github/file-filters.yml`, so we do not need to checkout # the head ref from potential forked repo. Instead, we are ok with the base branch # (i.e. getsentry master) - uses: actions/checkout@v2 - name: Check for frontend file changes uses: getsentry/paths-filter@v2 id: changes with: token: ${{ github.token }} filters: .github/file-filters.yml - name: getsentry token uses: getsentry/action-github-app-token@v1 id: getsentry with: app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }} private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} # Notify getsentry only if there were frontend files changed - name: Dispatch getsentry frontend tests uses: actions/github-script@v3 with: github-token: ${{ steps.getsentry.outputs.token }} script: | github.actions.createWorkflowDispatch({ owner: 'getsentry', repo: 'getsentry', workflow_id: 'js-build-and-lint.yml', ref: 'master', inputs: { 'skip': "${{ steps.changes.outputs.frontend != 'true' }}", 'sentry-sha': '${{ github.event.pull_request.head.sha }}', } })