Skip to content

Conversation

@jsinger67
Copy link
Owner

Potential fix for https://github.com/jsinger67/scnr2/security/code-scanning/1

To fix this issue, we need to explicitly set the permissions key for the workflow or for the individual job to restrict the GITHUB_TOKEN permissions to only what is needed. For this workflow, because it just checks out code, builds, and runs tests, it only needs read access to repository contents. You can set this at the workflow root, which will apply the restriction to all jobs unless overridden, or at the job level. The best practice is to set permissions: contents: read at the root of the workflow, above the jobs: block, ensuring all jobs inherit the minimal permissions required. This change should be made in .github/workflows/rust.yml by inserting the block after the name: and before on:.

No additional imports, methods, or external libraries are needed.


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>
@jsinger67 jsinger67 marked this pull request as ready for review October 1, 2025 09:08
@jsinger67 jsinger67 merged commit f44f415 into main Oct 1, 2025
4 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.

2 participants