Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#11

Closed
assapir wants to merge 1 commit intomainfrom
alert-autofix-3
Closed

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#11
assapir wants to merge 1 commit intomainfrom
alert-autofix-3

Conversation

@assapir
Copy link
Owner

@assapir assapir commented Nov 23, 2025

Potential fix for https://github.com/assapir/yahf/security/code-scanning/3

To fix this issue, we should add a permissions block to the workflow. The best way to do this is to set it at the root level of the workflow file, so the permissions apply to all jobs unless overridden. Based on the jobs shown ("build" and "examples"), the minimum needed is read access to repository contents since both jobs only seem to check out code and run tests or examples—no publishing, no writing to issues, or other writing operations. Edit the file .github/workflows/ci.yml and insert the following block after the workflow name and before the on key:

permissions:
  contents: read

No imports, function definitions, or broader changes are required.


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>
@assapir assapir closed this Nov 23, 2025
@assapir assapir deleted the alert-autofix-3 branch November 23, 2025 20:28
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