Skip to content

Potential fix for code scanning alert no. 390: Workflow does not contain permissions#144

Merged
dkmstr merged 1 commit into
masterfrom
alert-autofix-390
Nov 3, 2025
Merged

Potential fix for code scanning alert no. 390: Workflow does not contain permissions#144
dkmstr merged 1 commit into
masterfrom
alert-autofix-390

Conversation

@dkmstr
Copy link
Copy Markdown
Contributor

@dkmstr dkmstr commented Nov 3, 2025

Potential fix for https://github.com/VirtualCable/openuds/security/code-scanning/390

The best way to fix this problem is to explicitly add a permissions block that sets minimal required privileges for this workflow. For most testing workflows where you only need to check out the code and run tests, contents: read is sufficient. You should add the block either at the root of the workflow (to apply to all jobs) or directly under the test job. Since there is only a single job here, adding at the root is clear and future-proof.

Specifically, edit .github/workflows/test.yml and insert the following after the workflow name but before on: (at line 2 or 3):

permissions:
  contents: read

No additional methods, imports, or definitions are needed. This edit will ensure the workflow and its jobs run with least privilege, addressing CodeQL's flagged issue.


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

…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@dkmstr dkmstr marked this pull request as ready for review November 3, 2025 23:41
@dkmstr dkmstr merged commit 27de5e0 into master Nov 3, 2025
7 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.

1 participant