Skip to content

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

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

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

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/1

To fix the problem, you should add a permissions block to the workflow or to the specific job(s) that limits the permissions of the GITHUB_TOKEN to only what is necessary. In this case, the workflow only needs to read repository contents (for checkout and possibly for build/linting), so the minimal permissions block should be contents: read. This can be added either at the root of the workflow (to apply to all jobs) or at the job level (to apply only to the specific job). The best practice is to add it at the root unless different jobs require different permissions. You should edit .github/workflows/ci.yml and insert the following block after the name: CI line (before on:):

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 11a6841 into main Aug 16, 2025
6 checks passed
@kehiy
kehiy deleted the alert-autofix-1 branch August 16, 2025 09:32
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