Skip to content

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

Merged
arv merged 1 commit into
mainfrom
arv/alert-autofix-9
May 18, 2026
Merged

Potential fix for code scanning alert no. 9: Workflow does not contain permissions#34
arv merged 1 commit into
mainfrom
arv/alert-autofix-9

Conversation

@arv
Copy link
Copy Markdown
Contributor

@arv arv commented May 18, 2026

Potential fix for https://github.com/rocicorp/zero-virtual/security/code-scanning/9

Add an explicit permissions block to the workflow so the GITHUB_TOKEN is constrained to least privilege.
Best fix here: set workflow-level permissions to contents: read, since all shown jobs are test-oriented and only need repository read access (for checkout). This preserves functionality while making permissions explicit and stable across environments.

Edit file .github/workflows/test.yml by inserting a top-level permissions: section between on: and jobs: (or anywhere at top-level), with:

  • contents: read

No imports, methods, or dependencies are needed.

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>
@arv arv marked this pull request as ready for review May 18, 2026 09:27
@arv arv enabled auto-merge (squash) May 18, 2026 09:28
@arv arv merged commit c99aa99 into main May 18, 2026
8 checks passed
@arv arv deleted the arv/alert-autofix-9 branch May 18, 2026 09:29
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