Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions - #4

Merged
maxammann merged 1 commit into
mainfrom
alert-autofix-2
Jan 14, 2026
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#4
maxammann merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@maxammann

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/KittyCAD/ruleset-policy-bot/security/code-scanning/2

In general, the fix is to explicitly declare permissions for the GITHUB_TOKEN in the workflow, either at the root level (applies to all jobs) or per job. Since this workflow currently has just one job (build) that only needs to read repository contents to check out the code, the least-privilege configuration is to set contents: read. This both satisfies CodeQL and adheres to GitHub’s recommended baseline.

The single best fix without changing functionality is to add a permissions block under the build job (or alternatively at the root level) granting only read access to repository contents. Concretely, in .github/workflows/build.yml, insert:

    permissions:
      contents: read

right after runs-on: ubuntu-latest (line 11). No other steps need write access, and actions/checkout works with contents: read. No imports or external tools are required; it’s a pure YAML configuration change.

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>
@maxammann
maxammann marked this pull request as ready for review January 14, 2026 14:41
@maxammann
maxammann merged commit 5d1bf48 into main Jan 14, 2026
5 checks passed
@maxammann
maxammann deleted the alert-autofix-2 branch January 14, 2026 14:41
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