Skip to content

fix(canary): request permission-workflows:write for tag-move token (unblocks .github promotions)#807

Merged
don-petry merged 1 commit into
mainfrom
fix/canary-workflows-perm
Jul 19, 2026
Merged

fix(canary): request permission-workflows:write for tag-move token (unblocks .github promotions)#807
don-petry merged 1 commit into
mainfrom
fix/canary-workflows-perm

Conversation

@don-petry

@don-petry don-petry commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Validated live before merge: dispatched canary-rollout from this branch → promoted agent-shield/v2-ring0 (was 403 'Resource not accessible by integration' on every .github move since ~2026-07-13).

Root cause: the repo-scoped write token was minted permission-contents: write only, so create-github-app-token restricted it to contents — even after the release-manager App was granted workflows: write. Moving a channel tag on the .github repo (whose HEAD touches .github/workflows/**) requires the workflows permission or GitHub returns 403 via the git-refs API (the 'create/update workflow without workflows permission' block). Fix = request permission-workflows: write so the minted token carries it.

Refs prior investigation #743/#744/#745/#749; community discussions #26164, #109715.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved canary rollout reliability by ensuring the required permissions are available when updating channel tags in repositories with workflow-related changes.

The repo-scoped write token was minted with permission-contents:write only, so
create-github-app-token restricted it to contents — even after the release-manager
App was granted workflows:write. Moving a channel tag on the .github repo (whose
HEAD touches .github/workflows/**) requires the workflows permission or GitHub
returns 403 'Resource not accessible by integration' via the git-refs API. Request
it explicitly so the minted token carries it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner July 19, 2026 21:36
Copilot AI review requested due to automatic review settings July 19, 2026 21:36
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c2d5c950-c3ff-4d68-9c56-da3c1c36222f

📥 Commits

Reviewing files that changed from the base of the PR and between e680610 and 8ac4020.

📒 Files selected for processing (1)
  • .github/workflows/canary-rollout.yml

📝 Walkthrough

Walkthrough

The canary rollout workflow’s repo-scoped GitHub App token now explicitly requests workflows:write permission for channel tag ref updates involving workflow files.

Changes

Canary rollout permissions

Layer / File(s) Summary
GitHub App token permission update
.github/workflows/canary-rollout.yml
The token-minting step requests workflows:write and documents why the permission is needed for tag moves involving workflow state.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: needs-human-review

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding workflows:write permission to the canary tag-move token to unblock promotions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/canary-workflows-perm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #807
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-07-19T22:07:19Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-07-19T22:07:19Z

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry enabled auto-merge (squash) July 19, 2026 21:37
@don-petry
don-petry disabled auto-merge July 19, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Canary Rollout workflow’s repo-scoped “tag move” GitHub App token to request workflows: write, addressing GitHub’s permission enforcement when moving channel tags in the .github repository (whose commits routinely touch .github/workflows/**).

Changes:

  • Add permission-workflows: write to the actions/create-github-app-token inputs for the repo-scoped write token.
  • Document why workflows: write is required for channel tag moves in .github and why it must be explicitly requested at mint time.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
- Quality Gate PASSED with zero issues identified
Files changed: None (no action required)
Skipped (informational): 0
Status: ✅ No changes needed — PR ready to merge
```

@don-petry
don-petry enabled auto-merge (squash) July 19, 2026 21:38
@don-petry
don-petry merged commit 42b9f32 into main Jul 19, 2026
29 checks passed
@don-petry
don-petry deleted the fix/canary-workflows-perm branch July 19, 2026 21:39
don-petry added a commit that referenced this pull request Jul 19, 2026
…s:write) (#812)

The canary-rollout header listed the App's perms but omitted Workflows:write, which
#807 established is REQUIRED to move channel tags on workflow-heavy repos like
.github (else 403 'Resource not accessible by integration'). Spell out the full
required-permission set + the grant-AND-request rule (create-github-app-token drops
any permission the mint step doesn't list). Also fix the stale ADR line that still
named GH_PAT_WORKFLOWS as the mover.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants