Skip to content

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

Merged
wwade merged 1 commit into
mainfrom
alert-autofix-1
May 11, 2026
Merged

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

Conversation

@wwade
Copy link
Copy Markdown
Owner

@wwade wwade commented May 11, 2026

Potential fix for https://github.com/wwade/jobrunner/security/code-scanning/1

Add an explicit top-level permissions block in .github/workflows/check.yml so all jobs inherit least-privilege token access by default.

Best fix (without changing functionality):

  • Insert at workflow root (after on: block, before jobs:):
    • permissions:
    • contents: read

Why this is best here:

  • Both jobs are CI-only (checkout, setup, install, lint/test, status aggregation) and do not need write scopes.
  • Root-level permissions avoids duplication and applies consistently to all current/future jobs unless overridden.
  • Keeps behavior unchanged while satisfying CodeQL and least-privilege guidance.

No imports, methods, or extra definitions are needed (YAML workflow 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>
@wwade wwade marked this pull request as ready for review May 11, 2026 19:04
@wwade wwade enabled auto-merge (squash) May 11, 2026 19:04
@wwade wwade merged commit 1571c39 into main May 11, 2026
10 checks passed
@wwade wwade deleted the alert-autofix-1 branch May 11, 2026 19:05
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