Skip to content

ci: fix for Workflow does not contain permissions#116

Merged
fzipi merged 1 commit intomainfrom
alert-autofix-2
Feb 9, 2026
Merged

ci: fix for Workflow does not contain permissions#116
fzipi merged 1 commit intomainfrom
alert-autofix-2

Conversation

@fzipi
Copy link
Copy Markdown
Member

@fzipi fzipi commented Feb 9, 2026

Potential fix for https://github.com/coreruleset/secrules_parsing/security/code-scanning/2

In general, the fix is to add an explicit permissions block to the workflow (either at the top level or per job) and set it to the minimal access required. For a regression test workflow that only checks out code and runs tests, read-only repository contents are sufficient in most cases, so contents: read is an appropriate baseline.

The single best fix here is to define workflow-wide permissions just under the name and on keys, so they apply to all jobs that don’t override them. The existing steps (actions/checkout, actions/setup-python, abatilo/actions-poetry, and running tests/commands) all function correctly with only read access to repository contents and default read access to other scopes. No changes to the job steps are necessary. Concretely, in .github/workflows/test.yml, insert:

permissions:
  contents: read

between the on: [push, pull_request] line and the jobs: line. No imports or other definitions are needed as this is purely a YAML configuration change.

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>
@fzipi fzipi marked this pull request as ready for review February 9, 2026 01:35
@fzipi fzipi changed the title Potential fix for code scanning alert no. 2: Workflow does not contain permissions ci: fix for Workflow does not contain permissions Feb 9, 2026
@fzipi fzipi merged commit c62c59b into main Feb 9, 2026
33 checks passed
@fzipi fzipi deleted the alert-autofix-2 branch February 9, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant