Skip to content

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

Merged
rossaddison merged 1 commit intomasterfrom
alert-autofix-1
Dec 20, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#9
rossaddison merged 1 commit intomasterfrom
alert-autofix-1

Conversation

@rossaddison
Copy link
Owner

Potential fix for https://github.com/rossaddison/data-cycle/security/code-scanning/1

In general, the fix is to explicitly set a permissions block either at the top level of the workflow (to apply to all jobs) or within the specific job. Since this workflow only needs to read the repository contents and upload coverage to Codecov using an explicit secret token (not GITHUB_TOKEN), the minimal permission contents: read is sufficient. This conforms to CodeQL’s suggested baseline and the principle of least privilege.

The best fix here is to add a workflow‑level permissions section just below the name: mssql line (around line 19), setting contents: read. This will apply to the tests job and any future jobs unless they override it. No changes are needed to steps or external actions because actions/checkout and actions/cache work with a read‑only token for this use case, and Codecov is using secrets.CODECOV_TOKEN. No additional imports or methods are required since this is a YAML configuration change only.

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>
@rossaddison rossaddison marked this pull request as ready for review December 20, 2025 12:02
@rossaddison rossaddison merged commit 8ce9e67 into master Dec 20, 2025
27 of 33 checks passed
@rossaddison rossaddison deleted the alert-autofix-1 branch December 20, 2025 12:02
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