mirror of
https://github.com/r3bo0tbx1/tor-guard-relay.git
synced 2026-04-06 00:32:04 +02:00
Potential fix for code scanning alert no. 8: Workflow does not contain permissions #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @r3bo0tbx1 on 2/5/2026
Potential fix for https://github.com/r3bo0tbx1/tor-guard-relay/security/code-scanning/8
In general, the fix is to add a
permissionsblock that restricts theGITHUB_TOKENto the least privileges required. For this job, the only capability needed is the ability to request reviewers on pull requests, which requirespull-requests: write. It does not need broadcontents: writeor other elevated scopes, so we should explicitly set a minimal set of permissions.The best fix, without changing existing functionality, is to add a job-level
permissionsblock underjobs.assign, specifyingpull-requests: write. This keeps the scope local to this job, avoids affecting other workflows, and clearly documents the intent. Concretely, in.github/workflows/assign.yml, underjobs: assign:, add:at the same indentation level as
if:andruns-on:. No new imports or external actions are required; GitHub Actions’ built-in permission system handles this.Suggested fixes powered by Copilot Autofix. Review carefully before merging.