Skip to content

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

Closed
nickk02 wants to merge 1 commit into
mainfrom
alert-autofix-2
Closed

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#4
nickk02 wants to merge 1 commit into
mainfrom
alert-autofix-2

Conversation

@nickk02

@nickk02 nickk02 commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/nicolassanchez02/war-of-kings/security/code-scanning/2

Add an explicit top-level permissions block in .github/workflows/ci.yml so all jobs inherit minimal required GITHUB_TOKEN scope.
Best fix here is to set:

  • contents: read

This preserves existing behavior (checkout, restore/build/test) while enforcing least privilege across all jobs. Place the block near the top of the workflow (after on: is standard and clear). No imports, methods, or external definitions 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>
Signed-off-by: Nicolas Sanchez <98576999+nicolassanchez02@users.noreply.github.com>
@nickk02 nickk02 closed this May 28, 2026
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