Potential fix for code scanning alert no. 9: Workflow does not contain permissions - #122
Closed
gerlero wants to merge 1 commit into
Closed
Potential fix for code scanning alert no. 9: Workflow does not contain permissions#122gerlero wants to merge 1 commit into
gerlero wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
=======================================
Coverage 75.71% 75.71%
=======================================
Files 6 6
Lines 1149 1149
=======================================
Hits 870 870
Misses 279 279 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gerlero
marked this pull request as ready for review
November 21, 2025 04:15
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
gerlero
force-pushed
the
alert-autofix-9
branch
from
November 21, 2025 04:15
95388db to
7aa03d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/gerlero/fronts/security/code-scanning/9
To resolve this issue, an explicit top-level
permissionsblock should be added to the workflow. This restricts the default permissions of theGITHUB_TOKENto the least privilege that covers the needs of the workflow. Here, none of the jobs appear to need write access: actions like checkout, Ruff linting/formatting, mypy, pytest, and uv build do not require write permission to repository contents. The only exception may be the use of codecov/codecov-action, but uploading coverage just requires reading from the repository and using the secret; it does not adjust the repo state.Therefore, the best fix is to add at the root - directly after the
name: CIline (beforeon:) - the line:This will apply to all jobs unless overridden and follows GitHub's recommendation for the minimum baseline. If any job later requires greater permissions, a more specific
permissionsblock can be applied on that job only.Files/Regions to change:
.github/workflows/ci.yml, after thename: CIline (line 1), insert thepermissionsblock.What is needed:
Suggested fixes powered by Copilot Autofix. Review carefully before merging.