Skip to content

fix(ci): set minimal permissions for test workflow#127

Merged
CoderCoco merged 1 commit into
mainfrom
alert-autofix-12
May 9, 2026
Merged

fix(ci): set minimal permissions for test workflow#127
CoderCoco merged 1 commit into
mainfrom
alert-autofix-12

Conversation

@CoderCoco
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/CoderCoco/game-server-deploy/security/code-scanning/12

Add an explicit permissions block to .github/workflows/test.yml at the workflow root so it applies to all jobs (including test) unless overridden.
For this workflow, the best minimal permission is:

  • contents: read

This is sufficient for actions/checkout and typical test execution, and it documents least privilege without changing functionality.

Edit region: near the top-level keys (name, on, jobs) in .github/workflows/test.yml, inserting permissions between on and jobs (or anywhere at root level).

No imports, methods, or additional definitions are needed.

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

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@CoderCoco CoderCoco marked this pull request as ready for review May 9, 2026 15:17
Copilot AI review requested due to automatic review settings May 9, 2026 15:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an explicit root-level GitHub Actions permissions block to address code scanning alert #12 by enforcing least-privilege defaults for the Test workflow.

Changes:

  • Set workflow-wide permissions to contents: read in .github/workflows/test.yml.

Comment on lines +8 to +10
permissions:
contents: read

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change is already correct — permissions: contents: read is in place. However, I'm unable to rename the PR title through the tools available to me. Please update it manually in the GitHub UI to:

fix(ci): set minimal permissions for test workflow

@CoderCoco CoderCoco changed the title Potential fix for code scanning alert no. 12: Workflow does not contain permissions fix(ci): set minimal permissions for test workflow May 9, 2026
@CoderCoco CoderCoco merged commit cf2869f into main May 9, 2026
13 checks passed
@CoderCoco CoderCoco deleted the alert-autofix-12 branch May 9, 2026 16:12
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.

3 participants