forked from getsentry/sentry
43 lines (38 loc) · 1.44 KB
/
getsentry-dispatch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Dispatch a request to getsentry to run getsentry 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:
dispatch:
name: getsentry dispatch
runs-on: ubuntu-20.04
steps:
# Need to checkout just for `github/file-filters.yml`
- uses: actions/checkout@v2
- name: Check for 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 }}
- name: Dispatch getsentry tests
uses: actions/github-script@v3
with:
github-token: ${{ steps.getsentry.outputs.token }}
script: |
require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/getsentry-dispatch`).dispatch({
github,
context,
fileChanges: ${{ toJson(steps.changes.outputs) }}
});