Skip to content

Potential fix for code scanning alert no. 8: Workflow does not contain permissions - #34

Closed
SmetDenis wants to merge 1 commit into
masterfrom
alert-autofix-8
Closed

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#34
SmetDenis wants to merge 1 commit into
masterfrom
alert-autofix-8

Conversation

@SmetDenis

Copy link
Copy Markdown
Member

Potential fix for https://github.com/JBZoo/PHPUnit/security/code-scanning/8

The proper way to address this is to add a permissions block at either the workflow or job level, specifying the least privilege required. Because there is no evidence that any step in any job needs write permissions, and most steps only require how to checkout code or upload artifacts, setting the minimal feasible permission (contents: read) at the workflow level makes sense. This will apply to all jobs (phpunit, linters, report) and can be overridden in any individual job if necessary in the future. To implement, add:

permissions:
  contents: read

immediately after the workflow name: declaration (line 13). No further code, imports, or modifications are required, as this is a YAML/metadata configuration.


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>
@SmetDenis SmetDenis closed this Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant