Skip to content

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

Closed
tse-wei-chen wants to merge 1 commit into
mainfrom
alert-autofix-21
Closed

Potential fix for code scanning alert no. 21: Workflow does not contain permissions#32
tse-wei-chen wants to merge 1 commit into
mainfrom
alert-autofix-21

Conversation

@tse-wei-chen
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/tse-wei-chen/hs-sql-agent/security/code-scanning/21

Add an explicit workflow-level permissions block in .github/workflows/test.yml so all jobs inherit least-privilege token access.
Best fix here: add at the root (after name and before on) with:

  • contents: read

This preserves current functionality (checkout and tests still work) while preventing unintended write access if defaults are permissive or change later. No imports, methods, or dependencies 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>
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