Skip to content

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

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

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

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

Add an explicit permissions block at the workflow root so all jobs inherit least privilege by default, while granting the minimum write scope needed for labeling PRs.

Best single fix (without changing functionality):

  • Edit .github/workflows/merge-conflict-autolabel.yml.
  • Add a root-level permissions block after concurrency (or before jobs), with:
    • contents: read (safe minimal read access)
    • pull-requests: write (needed to add labels on PRs)

No imports, methods, or dependencies are needed; this is a YAML configuration change only.

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>
@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