Skip to content

Commit d201e00

Browse files
ci(combine-prs): support optional PAT to trigger downstream CI (#250)
PRs created by the default `GITHUB_TOKEN` don't fire `pull_request` events (GitHub anti-recursion), so consolidated PRs sit with no CI until someone close+reopens them. This PR wires `combine-prs.yml` to prefer `secrets.COMBINE_PRS_TOKEN` (fine-grained PAT, scopes: `contents:write` + `pull-requests:write` on this repo) when present, falling back to `GITHUB_TOKEN`. ## After merge — one-time setup 1. Create a **fine-grained PAT** at https://github.com/settings/personal-access-tokens/new - Resource owner: `dorlugasigal` - Repository access: only `TermBeam` - Permissions: **Contents: Read and write**, **Pull requests: Read and write** - Expiration: whatever fits your policy 2. Add it as a repo secret: `gh secret set COMBINE_PRS_TOKEN --repo dorlugasigal/TermBeam --body '<paste-token>'` 3. Done — next Dependabot wave will auto-create the combined PR **and** start CI on it. If the secret is not set, behavior is unchanged (combined PR is created, but CI needs a manual close+reopen kick). ## What changed - `combine-prs.yml` checkout `token:` and step `GH_TOKEN` env now read `secrets.COMBINE_PRS_TOKEN || secrets.GITHUB_TOKEN` - Header comment documents the why + how-to-enable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6d84be9 commit d201e00

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/combine-prs.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ name: Combine Dependabot PRs
3232
# never checks out PR-supplied code. It only invokes `gh` + `git` on
3333
# PR refs to merge their commits into our branch. No PR-controlled
3434
# script executes here.
35+
#
36+
# Token note:
37+
# PRs created with the default `GITHUB_TOKEN` do NOT trigger downstream
38+
# workflow runs (GitHub anti-recursion). To get CI to start on the
39+
# combined PR automatically, add a fine-grained PAT as repository secret
40+
# `COMBINE_PRS_TOKEN` (scopes: contents:write, pull-requests:write).
41+
# Without that secret the workflow still falls back to `GITHUB_TOKEN`,
42+
# the combined PR will be created, but you'll have to close+reopen it
43+
# once to kick CI.
3544
on:
3645
pull_request_target:
3746
types: [opened, reopened, ready_for_review, labeled]
@@ -74,7 +83,7 @@ jobs:
7483
with:
7584
fetch-depth: 0
7685
ref: main
77-
token: ${{ secrets.GITHUB_TOKEN }}
86+
token: ${{ secrets.COMBINE_PRS_TOKEN || secrets.GITHUB_TOKEN }}
7887

7988
- name: Configure git
8089
run: |
@@ -83,7 +92,7 @@ jobs:
8392
8493
- name: Combine open Dependabot PRs
8594
env:
86-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
GH_TOKEN: ${{ secrets.COMBINE_PRS_TOKEN || secrets.GITHUB_TOKEN }}
8796
DRY_RUN: ${{ inputs.dry-run }}
8897
run: |
8998
set -euo pipefail

0 commit comments

Comments
 (0)