Skip to content

Commit dfb58f1

Browse files
authored
feat: use GitHub App token for release-please identity separation (#89)
Use patchloom-release App token for release-please so PRs are authored by patchloom-release[bot] instead of github-actions[bot]. This fixes the auto-approve self-approval deadlock (github-actions[bot] cannot approve its own PRs) and enables CI to trigger on release PR updates (GITHUB_TOKEN events are suppressed by GitHub). - Add create-github-app-token step in release.yml - Pass app token to release-please-action - Add patchloom-release[bot] to auto-approve trusted actors Closes #77 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent e24a3cc commit dfb58f1

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/auto-approve.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
pull-requests: write
2222
if: >-
2323
github.event.pull_request.user.login != 'github-actions[bot]' &&
24-
(github.actor == 'SebTardif' || github.actor == 'dependabot[bot]')
24+
(github.actor == 'SebTardif' ||
25+
github.actor == 'dependabot[bot]' ||
26+
github.actor == 'patchloom-release[bot]')
2527
steps:
2628
- name: Harden runner
2729
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ jobs:
2727
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
2828
with:
2929
egress-policy: audit
30+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
31+
id: app-token
32+
with:
33+
app-id: ${{ secrets.APP_ID }}
34+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
3035
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
3136
id: release
3237
with:
38+
token: ${{ steps.app-token.outputs.token }}
3339
config-file: release-please-config.json
3440
manifest-file: .release-please-manifest.json
3541

0 commit comments

Comments
 (0)