Skip to content

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

Merged
kehiy merged 1 commit into
mainfrom
alert-autofix-2
Aug 16, 2025
Merged

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

Conversation

@kehiy

@kehiy kehiy commented Aug 16, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/dezh-tech/rokovo-cli/security/code-scanning/2

To fix the problem, you should add a permissions block to the workflow or to the specific job. The minimal starting point is contents: read, which allows the workflow to read repository contents but not write to them. Since the workflow is publishing to PyPI and not performing any actions that require write access to the repository, this is sufficient. The best place to add this is at the job level (under build-and-publish:), unless you want to set it for all jobs in the workflow. You should insert the following block directly under the job name (line 10):

permissions:
  contents: read

No additional imports, methods, or definitions are needed.

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>
@kehiy
kehiy marked this pull request as ready for review August 16, 2025 09:31
@kehiy
kehiy requested a review from ZigBalthazar as a code owner August 16, 2025 09:31
@kehiy
kehiy merged commit 25ea269 into main Aug 16, 2025
6 checks passed
@kehiy
kehiy deleted the alert-autofix-2 branch August 16, 2025 09:31
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