Skip to content

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

Merged
CrazyBoy49z merged 1 commit into
mainfrom
alert-autofix-2
May 10, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#14
CrazyBoy49z merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@CrazyBoy49z
Copy link
Copy Markdown
Member

Potential fix for https://github.com/step2dev/lazy-setting/security/code-scanning/2

To fix the problem, you should add a permissions block to the workflow to explicitly restrict the permissions granted to the GITHUB_TOKEN. Since the workflow only needs to read repository contents (to check out code and run static analysis), the minimal required permission is contents: read. This block can be added either at the root of the workflow (to apply to all jobs) or at the job level. In this case, adding it at the job level (under jobs.phpstan) is sufficient and aligns with the CodeQL suggestion. No additional imports or definitions are needed; simply insert the permissions block with contents: read under the phpstan job.

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>
@CrazyBoy49z CrazyBoy49z marked this pull request as ready for review May 10, 2026 21:32
@CrazyBoy49z CrazyBoy49z merged commit 2a060a6 into main May 10, 2026
4 checks passed
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