Skip to content

Commit 76d8e44

Browse files
authored
chore(ci): Replace GH_CQ_BOT PAT with GitHub App tokens (#239)
Replace GH_CQ_BOT PAT with short-lived tokens from the cloudquery-ci GitHub App.
1 parent 58d115f commit 76d8e44

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.github/.kodiak.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version = 1
22

33
[approve]
4-
auto_approve_usernames = ["cq-bot"]
4+
auto_approve_usernames = ["cloudquery-ci"]
55

66
[merge.message]
77
body = "pull_request_body"

.github/workflows/regen.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
timeout-minutes: 30
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Generate GitHub App token
16+
id: app-token
17+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
18+
with:
19+
app-id: ${{ secrets.CQ_APP_ID }}
20+
private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }}
21+
permission-contents: write
22+
permission-pull-requests: write
1523
- name: Checkout
1624
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1725
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
@@ -29,11 +37,10 @@ jobs:
2937
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
3038
with:
3139
# required so the PR triggers workflow runs
32-
token: ${{ secrets.GH_CQ_BOT }}
40+
token: ${{ steps.app-token.outputs.token }}
3341
branch: fix/gen_proto
3442
base: main
3543
title: "fix: Generate Java Code from `plugin-pb`"
3644
commit-message: "fix: Generate Java Code from `plugin-pb`"
3745
body: This PR was created by a scheduled workflow to regenerate the Java code from `plugin-pb`.
38-
author: cq-bot <cq-bot@users.noreply.github.com>
3946
labels: automerge

.github/workflows/release_pr.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ jobs:
1111
release-please:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- name: Generate GitHub App token
15+
id: app-token
16+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3
17+
with:
18+
app-id: ${{ secrets.CQ_APP_ID }}
19+
private-key: ${{ secrets.CQ_APP_PRIVATE_KEY }}
20+
permission-contents: write
21+
permission-pull-requests: write
1422
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4
1523
id: release
1624
with:
17-
token: ${{ secrets.GH_CQ_BOT }}
25+
token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)