Skip to content

Potential fix for code scanning alert no. 10: Workflow does not contain permissions#5

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

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

Conversation

@rossaddison
Copy link
Owner

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

In general, the fix is to explicitly declare a permissions block for the workflow or for the phpunit job, granting only the least privileges required. For this workflow, the steps perform source checkout, dependency installation, tests, and uploading coverage to Codecov. These actions only require read access to the repository contents; they do not push commits, modify issues, or update pull requests. Therefore, the best fix is to set permissions: contents: read at the workflow level, right after the name: sqlite line. This will apply to all jobs that do not override permissions and satisfies the CodeQL recommendation.

Concretely, in .github/workflows/sqlite.yml, insert:

permissions:
  contents: read

between the existing name: sqlite line and the jobs: block. No additional imports or external dependencies are needed, and existing job steps remain unchanged. This will ensure the GITHUB_TOKEN is restricted to read-only access to repository contents for this workflow.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…in 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 11:21
@rossaddison rossaddison merged commit aacd7b6 into master Dec 20, 2025
24 of 30 checks passed
@rossaddison rossaddison deleted the alert-autofix-10 branch December 20, 2025 12:09
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