Skip to content

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

Merged
Agash merged 1 commit intomasterfrom
alert-autofix-1
Apr 17, 2026
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#2
Agash merged 1 commit intomasterfrom
alert-autofix-1

Conversation

@Agash
Copy link
Copy Markdown
Owner

@Agash Agash commented Apr 17, 2026

Potential fix for https://github.com/Agash/ObsWebSocket/security/code-scanning/1

Add an explicit permissions block to the build_and_test job so the GITHUB_TOKEN is constrained to least privilege for that job.
Best fix without changing functionality: set contents: read on build_and_test. This is the minimal recommended baseline and is sufficient for checkout/build/test/pack/artifact upload behavior in this workflow. Keep publish_nuget permissions unchanged (contents: read, id-token: write) because it has separate auth requirements.

Edit only .github/workflows/build.yml, in the build_and_test job header area (right after runs-on is the cleanest place).

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>
@Agash Agash marked this pull request as ready for review April 17, 2026 18:03
@Agash Agash merged commit 39f8809 into master Apr 17, 2026
4 checks passed
@Agash Agash deleted the alert-autofix-1 branch April 17, 2026 18:03
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