Skip to content

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

Merged
assapir merged 1 commit intomainfrom
alert-autofix-2
Nov 23, 2025
Merged

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

Conversation

@assapir
Copy link
Owner

@assapir assapir commented Nov 23, 2025

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

To fix the problem, add a permissions block specifying the lowest privileges required. In this workflow, both jobs (build and examples) are simply checking out source code and running tests and examples. They do not appear to require writing to the repository, modifying pull requests, or making releases. Therefore, it is sufficient and prudent to limit GITHUB_TOKEN permissions to contents: read. The recommended way is to add the following at the root of the workflow file (before the jobs: block), ensuring all jobs inherit these minimal permissions. No changes to imports, methods, or existing workflow functionality are needed.


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 marked this pull request as ready for review November 23, 2025 20:28
@assapir assapir merged commit d6a4aa5 into main Nov 23, 2025
7 checks passed
@assapir assapir deleted the alert-autofix-2 branch November 23, 2025 20:29
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