Skip to content

Potential fix for code scanning alert no. 17: Workflow does not contain permissions#91

Draft
Dwarfex wants to merge 1 commit intodevelopfrom
alert-autofix-17
Draft

Potential fix for code scanning alert no. 17: Workflow does not contain permissions#91
Dwarfex wants to merge 1 commit intodevelopfrom
alert-autofix-17

Conversation

@Dwarfex
Copy link
Copy Markdown
Member

@Dwarfex Dwarfex commented Apr 24, 2026

Potential fix for https://github.com/openfoodfacts/openfoodfacts-php/security/code-scanning/17

Add an explicit permissions block at the workflow root so it applies to all jobs (including tests) unless overridden.
For this CI workflow, the best minimal safe setting is:

  • contents: read

This supports code checkout and typical read-only CI operations while preventing unintended token write capabilities.

Where to change: .github/workflows/ci.yml, immediately after the on: trigger block (before jobs:).

No imports, methods, or additional definitions are needed.

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>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant