Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions - #5

Merged
rbenzing merged 1 commit into
mainfrom
alert-autofix-2
Oct 29, 2026
Merged

rbenzing merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@rbenzing

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/rbenzing/LibEmiddle/security/code-scanning/2

Add explicit permissions blocks to limit GITHUB_TOKEN scope to only what each job needs.

Best fix here (without changing functionality):

  • Add a job-level permissions block on validate with minimal read-only access (contents: read), since it only validates inputs and does not write.
  • Add a job-level permissions block on release with:
    • contents: write (needed for git push, tag push, and GitHub Release creation).
    • packages: write (appropriate for release/package publishing workflows and aligns with least-privilege for package-related actions).

This keeps behavior intact while making token privileges explicit and constrained per job.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rbenzing
rbenzing marked this pull request as ready for review October 29, 2026 14:19
@rbenzing
rbenzing merged commit 01a6bc6 into main Oct 29, 2026
6 checks passed
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