Skip to content

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

Merged
Rui Xia (harrysummer) merged 2 commits into
mainfrom
alert-autofix-1
Dec 9, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#69
Rui Xia (harrysummer) merged 2 commits into
mainfrom
alert-autofix-1

Conversation

@harrysummer

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/microsoft/visionmetrics/security/code-scanning/1

To fix the problem, add an explicit permissions block with the least privilege necessary. Since this workflow performs only code checkout and runs tests, it does not need any write permissions. The minimum required is contents: read, which allows the workflow to read the repository contents during checkout but forbids other write actions. You should add this block at the level of the test job in .github/workflows/test.yml (line 10), which applies only to this job. You do not need to change any existing functionality, and no other methods, imports, or definitions are required.

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

Rui Xia (harrysummer) and others added 2 commits December 5, 2025 12:17
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@harrysummer
Rui Xia (harrysummer) marked this pull request as ready for review December 9, 2025 19:33
@harrysummer Rui Xia (harrysummer) self-assigned this Dec 9, 2025
@harrysummer
Rui Xia (harrysummer) merged commit cc8852b into main Dec 9, 2025
5 checks passed
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