Skip to content

Commit 4ee295b

Browse files
ci: push release + screenshot commits via admin PAT to satisfy branch protection (#25)
main now requires the CLA Assistant check, which only runs on PRs — so the release bump (ci.yml) and the screenshots job, which push directly to main as github-actions[bot], were rejected. Check out with RELEASE_TOKEN (a fine-grained admin PAT) so the push bypasses protection (enforce_admins is off), and mark the release commit [skip ci] so the PAT-identity push doesn't re-trigger CI and double-publish. Requires a new repo secret RELEASE_TOKEN: fine-grained PAT, dev-coach only, Contents: Read and write.
1 parent 41d2be2 commit 4ee295b

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ jobs:
113113
version: ${{ steps.bump.outputs.version }}
114114
steps:
115115
- uses: actions/checkout@v7
116+
with:
117+
# Admin PAT (fine-grained, dev-coach only, Contents: RW) so the push to the
118+
# protected main branch bypasses branch protection (enforce_admins is off).
119+
# The default GITHUB_TOKEN runs as github-actions[bot], which is not an admin
120+
# and would be rejected by the required CLA check.
121+
token: ${{ secrets.RELEASE_TOKEN }}
116122
- uses: actions/setup-node@v6
117123
with:
118124
node-version-file: .node-version
@@ -131,7 +137,10 @@ jobs:
131137
git config user.email "github-actions[bot]@users.noreply.github.com"
132138
git add package.json package-lock.json mcpb/manifest.json \
133139
plugin/.claude-plugin/plugin.json plugin/skills/devcoach/SKILL.md plugin/package.json
134-
git commit -m "chore: release v${NEW}"
140+
# [skip ci] so neither the main push nor the tag push (both made with a real
141+
# PAT identity, which DOES re-trigger workflows) starts a second run that would
142+
# double-publish. Publish/release still run in THIS workflow_dispatch run via needs.bump.
143+
git commit -m "chore: release v${NEW} [skip ci]"
135144
git tag "v${NEW}"
136145
git push origin HEAD:main "v${NEW}"
137146
echo "version=${NEW}" >> "$GITHUB_OUTPUT"

.github/workflows/update-screenshots.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v7
14+
with:
15+
# Admin PAT so the screenshots commit can push to the protected main branch
16+
# (the default GITHUB_TOKEN bot is blocked by the required CLA check). The
17+
# commit message already carries [skip ci], so this push doesn't re-trigger CI.
18+
token: ${{ secrets.RELEASE_TOKEN }}
1419
- uses: actions/setup-node@v6
1520
with:
1621
node-version-file: .node-version

0 commit comments

Comments
 (0)