Browse Source

build(github): Dispatch a `getsentry` build for sentry PRs (#20367)

This uses [Github Actions' `workflow_dispatch`](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/) to [trigger](https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event) a `getsentry` build that will report back to the PR w/ build status.
Billy Vong 4 years ago
parent
commit
544f08bbdf
1 changed files with 27 additions and 0 deletions
  1. 27 0
      .github/workflows/acceptance.yml

+ 27 - 0
.github/workflows/acceptance.yml

@@ -6,6 +6,33 @@ on:
   pull_request:
 
 jobs:
+    getsentry:
+      if: ${{ github.ref != 'refs/heads/master' }}
+      runs-on: ubuntu-16.04
+      steps:
+        - name: getsentry token
+          id: getsentry
+          uses: getsentry/action-github-app-token@v1
+          with:
+            app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
+            private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
+
+        # Notify getsentry
+        - name: Dispatch getsentry tests
+          uses: actions/github-script@v3
+          with:
+            github-token: ${{ steps.getsentry.outputs.token }}
+            script: |
+              github.actions.createWorkflowDispatch({
+                owner: 'getsentry',
+                repo: 'getsentry',
+                workflow_id: 'acceptance.yml',
+                ref: 'master',
+                inputs: {
+                  sha: '${{ github.event.pull_request.head.sha }}',
+                }
+              })
+
     jest:
       runs-on: ubuntu-latest
       env: