Skip to content

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

Merged
karastoyanov merged 1 commit intomasterfrom
bugfix/alert-autofix-2
Oct 30, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#5
karastoyanov merged 1 commit intomasterfrom
bugfix/alert-autofix-2

Conversation

@karastoyanov
Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/VUTP-University/phd-lab-utp/security/code-scanning/2

To fix the problem, explicitly set the required minimal permissions for the workflow/job by adding a permissions block. As this workflow only needs to check out code and read file contents, the minimal permission is contents: read. This should be added either to the top-level of the workflow (so all jobs inherit it), or directly under the check-prints job if you anticipate extending the workflow later with other jobs with different needs. The recommended place is just beneath the name line, following the GitHub Actions convention. No new imports, methods, or code structure changes are required; only the addition of the permissions section in the YAML file.

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>
@karastoyanov karastoyanov marked this pull request as ready for review October 30, 2025 22:43
@karastoyanov karastoyanov merged commit b8e5776 into master Oct 30, 2025
4 checks passed
@karastoyanov karastoyanov deleted the bugfix/alert-autofix-2 branch November 10, 2025 18:50
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