@@ -3,46 +3,50 @@ name: 🏁 Run Release Performance Check
3
3
on :
4
4
issue_comment :
5
5
types : [created]
6
- branches :
7
- - main
8
- - " rc/**"
9
- - next
10
6
11
7
jobs :
12
8
dispatch-matrix-check :
13
9
runs-on : ubuntu-22.04
14
10
steps :
11
+ - name : Checkout repository
12
+ uses : actions/checkout@v4
15
13
16
- - name : Test Variables
17
- shell : pwsh
18
- run : |
19
- Write-Host "Running as: ${{github.actor}}"
20
-
21
- $actor = "${{github.actor}}"
22
-
23
- $acl = @("jsinglet","mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine")
24
-
25
- if(-not ($actor -in $acl)){
26
- throw "Refusing to run workflow for user not in acl."
27
- }
28
-
29
- - name : Dispatch Performance Testing Job
30
- if : ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') }}
31
- uses : peter-evans/repository-dispatch@v2
14
+ - name : Check permission
15
+ id : check-write-permission
16
+ uses : ./.github/actions/check-permissions
32
17
with :
33
- token : ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
34
- repository : github/codeql-coding-standards-release-engineering
35
- event-type : performance-test
36
- client-payload : ' {"pr": "${{ github.event.issue.number }}"}'
18
+ minimum-permission : " write"
37
19
20
+ - name : Generate token
21
+ id : generate-token
22
+ uses : actions/create-github-app-token@v1
23
+ with :
24
+ app-id : ${{ vars.AUTOMATION_APP_ID }}
25
+ private-key : ${{ secrets.AUTOMATION_PRIVATE_KEY }}
26
+ owner : ${{ github.repository_owner }}
27
+ repositories : " codeql-coding-standards-release-engineering"
28
+
29
+ - name : Invoke performance test
30
+ if : ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') && steps.check-write-permission.outputs.has-permission }}
31
+ env :
32
+ ISSUE_NR : ${{ github.event.issue.number }}
33
+ GH_TOKEN : ${{ steps.generate-token.outputs.token }}
34
+ run : |
35
+ jq -n \
36
+ --arg issue_nr "$ISSUE_NR" \
37
+ '{"issue-nr": $issue_nr}' \
38
+ | \
39
+ gh workflow run pr-performance-testing.yml \
40
+ --json \
41
+ -R github/codeql-coding-standards-release-engineering
38
42
39
43
- uses : actions/github-script@v6
40
- if : ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') }}
44
+ if : ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') && steps.check-write-permission.outputs.has-permission }}
41
45
with :
42
46
script : |
43
47
github.rest.issues.createComment({
44
48
issue_number: context.issue.number,
45
49
owner: context.repo.owner,
46
50
repo: context.repo.repo,
47
51
body: '🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute. <br><br> :bulb: If you do not hear back from me please check my status! **I will report even if I fail!**'
48
- })
52
+ })
0 commit comments