Potential fix for code scanning alert no. 5: Workflow does not contain permissions #38
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/edgee-cloud/segment-component/security/code-scanning/5
In general, to fix this type of issue you add a
permissionsblock either at the workflow root (applies to all jobs without their ownpermissions) or on the specific job. Here we already have a job (clippy) with its ownpermissionsblock, so the cleanest, least-disruptive fix is to add an explicit permissions block to thecoveragejob only. That addresses the CodeQL finding and keeps existing behavior of other jobs unchanged.Concretely, in
.github/workflows/check.yml, under thecoveragejob (line 84 onward), add apermissions:section specifying minimal permissions. As a safe minimal starting point aligned with the CodeQL suggestion, usecontents: read. If Coveralls needed extra scopes (likechecks: writeorstatuses: write), they could be added later, but we will not assume that without evidence in the snippet. The change is only to insert this permissions mapping undercoverage:at the same indentation level asruns-on:andsteps:.Suggested fixes powered by Copilot Autofix. Review carefully before merging.