Skip to content

fix: Potential fix for code scanning alert no. 13: Workflow does not contain permissions#189

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

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

Conversation

@teolemon
Copy link
Copy Markdown
Member

Potential fix for https://github.com/openfoodfacts/facets-knowledge-panels/security/code-scanning/13

The best way to fix this problem is to explicitly set the permissions key in the workflow or job definition to restrict the GITHUB_TOKEN to only the minimum necessary privileges. In this case, since the job is only validating PR titles, it likely requires read access to contents and may need write access to pull-requests to potentially comment or mark PRs. Add a permissions block either at the workflow root (global for all jobs) or just under the main job. For clarity, add it inside the main job (line 13), specifying:

permissions:
  contents: read
  pull-requests: write

Edit .github/workflows/semantic-pr.yml by inserting this block with proper indentation directly within the main job, before its steps.

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>
@teolemon teolemon changed the title Potential fix for code scanning alert no. 13: Workflow does not contain permissions fix: Potential fix for code scanning alert no. 13: Workflow does not contain permissions Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

1 participant