Skip to content

Potential fix for code scanning alert no. 30: Workflow does not contain permissions#830

Draft
teolemon wants to merge 1 commit intomainfrom
alert-autofix-30
Draft

Potential fix for code scanning alert no. 30: Workflow does not contain permissions#830
teolemon wants to merge 1 commit intomainfrom
alert-autofix-30

Conversation

@teolemon
Copy link
Member

@teolemon teolemon commented Nov 4, 2025

Potential fix for https://github.com/openfoodfacts/openfoodfacts-web/security/code-scanning/30

To fix this issue, add an explicit permissions block to restrict the GITHUB_TOKEN to read-only access. The CodeQL recommendation is permissions: contents: read, which is usually sufficient for jobs that only read repository contents (such as spellcheck and validation).

The change should be made at the workflow root level (just below the name and on blocks) in .github/workflows/push.yml. This ensures all jobs inherit the least privilege unless explicitly overridden.

No imports or additional definitions are required, just a one-line insertion. If some jobs in the future require more permissions, this block can be updated accordingly or overridden at the job level.


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

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To Discuss & Validate

Development

Successfully merging this pull request may close these issues.

1 participant