Skip to content

Potential fix for code scanning alert no. 12: Workflow does not contain permissions#93

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

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

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/12

Add an explicit permissions block to .github/workflows/semantic-pr.yml to enforce least privilege for GITHUB_TOKEN.
Best fix (without changing behavior): set workflow-level permissions to only what this PR-title validation needs:

  • contents: read
  • pull-requests: read

This keeps functionality (reading PR metadata/title) while preventing unnecessary write access.
Edit location: directly under the on: trigger block and before jobs: in .github/workflows/semantic-pr.yml.
No new imports, methods, or dependencies 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