-
Notifications
You must be signed in to change notification settings - Fork 59
52 lines (46 loc) · 1.99 KB
/
dispatch-matrix-test-on-comment.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
44
45
46
47
48
49
50
51
52
name: 🤖 Run Matrix Check (On Comment)
on:
issue_comment:
types: [created]
jobs:
dispatch-matrix-check:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check permission
id: check-write-permission
uses: ./.github/actions/check-permissions
with:
minimum-permission: "write"
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "codeql-coding-standards-release-engineering"
- name: Invoke matrix testing job
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') && steps.check-write-permission.outputs.has-permission }}
env:
ISSUE_NR: ${{ github.event.issue.number }}
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
jq -n \
--arg issue_nr "$ISSUE_NR" \
'{"issue-nr": $issue_nr}' \
| \
gh workflow run pr-compiler-validation.yml \
--json \
-R github/codeql-coding-standards-release-engineering
- uses: actions/github-script@v6
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') && steps.check-write-permission.outputs.has-permission }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results. <br><br> :bulb: If you do not hear back from me please check my status! **I will report even if this PR does not contain files eligible for matrix testing.**'
})