Skip to content

ci(FixPR): add explicit least-privilege permissions block#13402

Merged
cakebaker merged 1 commit into
uutils:mainfrom
kobihikri:fixpr-permissions
Jul 15, 2026
Merged

ci(FixPR): add explicit least-privilege permissions block#13402
cakebaker merged 1 commit into
uutils:mainfrom
kobihikri:fixpr-permissions

Conversation

@kobihikri

Copy link
Copy Markdown
Contributor

What this does

FixPR.yml is the only workflow of the 21 in .github/workflows/ with no permissions: block, so its GITHUB_TOKEN gets the repository's default scopes. This adds an explicit least-privilege block.

Why contents: write (not read)

The workflow runs on pull_request: [closed] when merged == true and its final step (EndBug/add-and-commit@v10) commits Cargo.lock back to main using GITHUB_TOKEN. So it genuinely needs contents: write — but nothing else. Making that explicit drops the other default token scopes (packages, actions, etc.) while keeping the auto-commit working.

This mirrors the hardening you already accepted in #12655 (adding an explicit permissions block to a workflow that CodeQL flagged).

Verification

for f in .github/workflows/*.yml; do grep -q 'permissions:' "$f" || echo "NO-PERMISSIONS: $f"; done
# → NO-PERMISSIONS: FixPR.yml   (only one, before this change)

Single-block addition, no behavior change.


Disclosure: I used an AI tool to help spot this and prepare the change; I verified it against the workflow and the #12655 precedent myself and take responsibility for it.

FixPR.yml had no permissions block, so GITHUB_TOKEN got the repo default.
It commits Cargo.lock back to main, so scope it to contents: write only.
Mirrors the hardening accepted in uutils#12655.
@HackingRepo

Copy link
Copy Markdown
Contributor

there was still massive supply chain security prs, i open importantly #13286, but step by step security

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/io-errors (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)

@cakebaker
cakebaker merged commit 52c9c16 into uutils:main Jul 15, 2026
160 of 162 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks for your PR!

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.

3 participants