Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#860

Merged
adwsingh merged 1 commit intomainfrom
alert-autofix-1
Aug 27, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#860
adwsingh merged 1 commit intomainfrom
alert-autofix-1

Conversation

@adwsingh
Copy link
Contributor

Potential fix for https://github.com/smithy-lang/smithy-java/security/code-scanning/1

To resolve the issue, add a permissions block with the minimum required privileges for the workflow. The best way to fix this is to add permissions: { contents: read } at the top level of the workflow (just after the name: line), which will apply to all jobs in the workflow except those with an override. This change preserves existing functionality while explicitly limiting the GITHUB_TOKEN's access. If the action needs to open pull requests, the minimal required write permission for that purpose (e.g., pull-requests: write or contents: write) should also be added, but with the information provided, start with contents: read as suggested by CodeQL.


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>
@adwsingh adwsingh marked this pull request as ready for review August 27, 2025 20:21
@adwsingh adwsingh enabled auto-merge (rebase) August 27, 2025 20:24
@adwsingh adwsingh requested a review from rhernandez35 August 27, 2025 20:32
@adwsingh adwsingh merged commit 4b49462 into main Aug 27, 2025
4 checks passed
@adwsingh adwsingh deleted the alert-autofix-1 branch August 27, 2025 20:55
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