Skip to content

Conversation

@teolemon
Copy link
Member

@teolemon teolemon commented Nov 4, 2025

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

The best way to fix the problem is to add an explicit permissions block to the workflow. Since this workflow only checks out the repository and runs a local Python script, it does not require write access to any resources. The minimal required permission is "contents: read", which allows the workflow to read repository contents but nothing else.
This can be set at the root workflow level (which will apply to all jobs unless overridden), but can also be placed on the individual job if you want to scope it more narrowly. In this case, the simplest, clearest solution is to add the following under the workflow name but before the on: block:

permissions:
  contents: read

No extra methods, imports, or other definitions are required.

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.

2 participants