Skip to content

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

Merged
Perry1231 merged 1 commit into
mainfrom
alert-autofix-1
Aug 3, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#21
Perry1231 merged 1 commit into
mainfrom
alert-autofix-1

Conversation

@Perry1231

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/Perry1231/Adventure-Game/security/code-scanning/1

Add an explicit permissions block to the workflow so GITHUB_TOKEN is scoped to least privilege.
For this workflow, the best fix is at the workflow root (applies to all jobs unless overridden), with:

  • contents: read

This is sufficient for actions/checkout@v4 and does not change existing functionality (build and run steps remain identical).
Edit file .github/workflows/c-cpp.yml, inserting the permissions block between the on: section and jobs:.

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>
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@Perry1231

Copy link
Copy Markdown
Owner Author

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

@Perry1231
Perry1231 marked this pull request as ready for review August 3, 2026 14:36
@Perry1231

Copy link
Copy Markdown
Owner Author

Pull Request try 2

@Perry1231
Perry1231 merged commit de7f629 into main Aug 3, 2026
5 of 6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Adventure-Game project Aug 3, 2026
@Perry1231
Perry1231 deleted the alert-autofix-1 branch August 3, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant