Skip to content

ci: ask for the token scopes these two workflows rely on - #501

Merged
yordis merged 1 commit into
masterfrom
yordis/feat-workflow-token-permissions
Sep 15, 2026
Merged

yordis merged 1 commit into
masterfrom
yordis/feat-workflow-token-permissions

Conversation

@yordis

@yordis yordis commented Sep 15, 2026

Copy link
Copy Markdown
Member
  • These are the only two workflows in the repository that get their write access from the organization's default token permission instead of declaring it. Everything else here already states what it needs.

  • That default is set for the whole organization, so these two are what keeps every other job across it holding a token that can write to its repository whether it asked for one or not. Naming the scopes here is what lets that default drop to read.

  • cherry-pick-pr-for-label runs on pull_request_target, which gives a fork's branch a token carrying the base repository's access. A job that says what it needs is worth more on that trigger than on any other.

Both take their write access from the organization default rather than
declaring it, which is the only thing keeping that default at write for every
other job in the organization that never needed it.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis requested a review from a team as a code owner September 15, 2026 20:08
@cursor

cursor Bot commented Sep 15, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI-only least-privilege token scoping; write scopes are unchanged for the jobs that already performed those operations.

Overview
Explicit GITHUB_TOKEN scopes for the cherry-pick and license update workflows so they no longer depend on the organization’s default write token.

Each workflow now sets permissions: {} at the top level and grants contents: write and pull-requests: write only on the job that cherry-picks or updates LICENSE.md. That matches the rest of the repo’s workflows and lets the org default token permission drop to read-only for jobs that do not request write access—including on pull_request_target for the cherry-pick workflow.

Reviewed by Cursor Bugbot for commit 45d6b59. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a545d500-9a0a-4740-bd71-1124ef09cf7b

📥 Commits

Reviewing files that changed from the base of the PR and between 67c9393 and 45d6b59.

📒 Files selected for processing (2)
  • .github/workflows/cherry-pick-pr-for-label.yml
  • .github/workflows/license.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The two GitHub Actions workflows now clear default token permissions and grant explicit write permissions to the jobs that create or update pull requests.

Changes

Workflow Permission Hardening

Layer / File(s) Summary
Explicit workflow job permissions
.github/workflows/cherry-pick-pr-for-label.yml, .github/workflows/license.yml
Both workflows set top-level permissions: {}. Their jobs explicitly grant contents: write and pull-requests: write.

Priority: ➖ Normal

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

Change: Other

Merge Risk: ⚪ Minimal · up to 45d6b

Both workflows retain the write access required for their repository updates while reducing unintended default token permissions, with no remaining merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: explicitly declaring the token scopes required by the two workflows.
Description check ✅ Passed The description directly explains the workflow permission changes, the organization-wide default, and the security relevance of pull_request_target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 yordis/feat-workflow-token-permissions

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

A rabbit checks the workflow gate
Empty defaults wait at the state
Write permissions stand clear
Cherry-pick paths persevere
License updates hop straight through

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

@yordis
yordis merged commit e48a12f into master Sep 15, 2026
30 checks passed
@yordis
yordis deleted the yordis/feat-workflow-token-permissions branch September 15, 2026 21:36
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.

1 participant