Potential fix for code scanning alert no. 3: Workflow does not contain permissions#423
Merged
reMRKableDev merged 1 commit intomainfrom Mar 13, 2026
Merged
Potential fix for code scanning alert no. 3: Workflow does not contain permissions#423reMRKableDev merged 1 commit intomainfrom
reMRKableDev merged 1 commit intomainfrom
Conversation
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
=======================================
Coverage 96.55% 96.55%
=======================================
Files 8 8
Lines 58 58
Branches 9 9
=======================================
Hits 56 56
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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/reMRKableDev/react-omdb-api/security/code-scanning/3
In general, the fix is to explicitly declare a
permissionsblock that scopes theGITHUB_TOKENto the least privileges the workflow needs. For this workflow, it only needs to read repository contents (foractions/checkout) and does not appear to need to write anything back to GitHub, socontents: readat the workflow or job level is sufficient. Other permissions likepull-requests,issues, etc. are not used here, so they should not be granted.The single best fix with minimal impact is to add a
permissionssection at the top level of.github/workflows/test-coverage.yml, right after thename:andon:block or beforejobs:. This will apply to all jobs that lack their ownpermissionsblock (here, thebuildjob). We’ll set:No additional imports or methods are required, since this is purely a configuration change within the workflow YAML.
Concretely:
.github/workflows/test-coverage.yml.permissions:block between theon:section (lines 3–7) and thejobs:section (line 9), or directly abovejobs:.Suggested fixes powered by Copilot Autofix. Review carefully before merging.