Skip to content

Commit 67cc2cd

Browse files
committed
Replace PAT with GitHub App
1 parent 7f62053 commit 67cc2cd

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/dispatch-matrix-check.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ jobs:
2020
with:
2121
minimum-permission: "write"
2222

23+
- name: Generate token
24+
id: generate-token
25+
uses: actions/create-github-app-token@eaddb9eb7e4226c68cf4b39f167c83e5bd132b3e
26+
with:
27+
app-id: ${{ vars.AUTOMATION_APP_ID }}
28+
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
29+
owner: ${{ github.repository_owner }}
30+
repositories: "codeql-coding-standards-release-engineering"
31+
2332
- name: Dispatch Matrix Testing Job
2433
if: steps.check-write-permission.outputs.has-permission
2534
uses: peter-evans/repository-dispatch@v2
2635
with:
27-
token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
36+
token: ${{ steps.generate-token.outputs.token }}
2837
repository: github/codeql-coding-standards-release-engineering
2938
event-type: matrix-test
3039
client-payload: '{"pr": "${{ github.event.number }}"}'

.github/workflows/dispatch-matrix-test-on-comment.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@ jobs:
1717
with:
1818
minimum-permission: "write"
1919

20+
- name: Generate token
21+
id: generate-token
22+
uses: actions/create-github-app-token@eaddb9eb7e4226c68cf4b39f167c83e5bd132b3e
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+
2029
- name: Dispatch Matrix Testing Job
2130
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') && steps.check-write-permission.outputs.has-permission }}
2231
uses: peter-evans/repository-dispatch@v2
2332
with:
24-
token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
33+
token: ${{ steps.generate-token.outputs.token }}
2534
repository: github/codeql-coding-standards-release-engineering
2635
event-type: matrix-test
2736
client-payload: '{"pr": "${{ github.event.issue.number }}"}'

.github/workflows/dispatch-release-performance-check.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@ jobs:
1717
with:
1818
minimum-permission: "write"
1919

20+
- name: Generate token
21+
id: generate-token
22+
uses: actions/create-github-app-token@eaddb9eb7e4226c68cf4b39f167c83e5bd132b3e
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+
2029
- name: Dispatch Performance Testing Job
2130
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') && steps.check-write-permission.outputs.has-permission }}
2231
uses: peter-evans/repository-dispatch@v2
2332
with:
24-
token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
33+
token: ${{ steps.generate-token.outputs.token }}
2534
repository: github/codeql-coding-standards-release-engineering
2635
event-type: performance-test
2736
client-payload: '{"pr": "${{ github.event.issue.number }}"}'

0 commit comments

Comments
 (0)