Skip to content

fix: Potential fix for code scanning alert no. 7: Workflow does not contain permissions#194

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

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

Conversation

@teolemon
Copy link
Copy Markdown
Member

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

To fix this problem, you should add a permissions key to the workflow YAML file. For maximum clarity and security, add it at the top level, just below the workflow name and event triggers. Review the steps: The workflow uses Crowdin to download/upload translations, and then creates pull requests. According to Crowdin Action documentation and general GitHub Actions usage, it needs ability to read code and create pull requests but does not need full write access to code or issues. Therefore, set contents: read (so workflow jobs can read source and translation files) and pull-requests: write (to allow PR creation).

Edit .github/workflows/crowdin.yml, adding:

permissions:
  contents: read
  pull-requests: write

just after the workflow name and before on: or after on:.

No other code imports or steps need to be changed.


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>
@teolemon teolemon changed the title Potential fix for code scanning alert no. 7: Workflow does not contain permissions fix: Potential fix for code scanning alert no. 7: 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