Skip to content

Potential fix for code scanning alert no. 2884: Workflow does not contain permissions#6

Closed
Lawrence Lucas Large (LukeLarge) wants to merge 1 commit intomainfrom
alert-autofix-2884
Closed

Potential fix for code scanning alert no. 2884: Workflow does not contain permissions#6
Lawrence Lucas Large (LukeLarge) wants to merge 1 commit intomainfrom
alert-autofix-2884

Conversation

@LukeLarge
Copy link
Collaborator

Potential fix for https://github.com/LukeLarge/contracts/security/code-scanning/2884

To fix this issue, we need to add a permissions block that explicitly sets the GitHub token permissions to the minimum required. In this case, the workflow steps only check out code and run local commands (configure, make, etc.), with no evidence of requiring write access (such as creating PRs, releasing packages, or modifying repo contents). The optimal minimal permission is thus just contents: read. This block can be added either at the top level (applies to all jobs) or under the build job. Since there is a single job and the recommendation highlights placing it at the root when possible, we should add it at the root, directly after the name: line for clarity and inheritance.

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

…tain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Lawrence Lucas Large <162439255+LukeLarge@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 9, 2025 19:17
@LukeLarge
Copy link
Collaborator Author

approve changes

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