name: sentry pull request bot # Note this event happens on Issue comments AND PR comments, # we make sure that we only respond to PR comments. on: issue_comment: types: [created, edited] pull_request: types: [opened, edited] jobs: # TODO(billy): Move this into an external action as we add more functionality test-getsentry: name: test getsentry runs-on: ubuntu-20.04 # Ensure this bot only responds for pull requests and only for the main repository if: >- (github.event.issue.pull_request.url != '' || github.event.pull_request.id != '') && (contains(github.event.comment.body, '#test-getsentry') || contains(github.event.pull_request.body, '#test-getsentry')) && github.repository == 'getsentry/sentry' steps: - name: Check getsentry membership id: org uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # v3 with: script: | try { const result = await github.orgs.checkMembershipForUser({ org: 'getsentry', username: context.payload.sender.login, }) return result.status == 204; } catch { return false; } - name: Fetch getsentry token if: steps.org.outputs.result == 'true' id: getsentry uses: getsentry/action-github-app-token@38a3ce582e170ddfe8789f509597c6944f2292a9 # v1 with: app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }} private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} - name: Dispatch getsentry tests if: steps.org.outputs.result == 'true' uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # v3 with: github-token: ${{ steps.getsentry.outputs.token }} script: | github.actions.createWorkflowDispatch({ owner: 'getsentry', repo: 'getsentry', workflow_id: 'acceptance.yml', ref: 'master', inputs: { 'sentry-sha': '${{ github.event.pull_request.head.sha }}', } })