Skip to content

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

Merged
dev-shimada merged 1 commit into
mainfrom
alert-autofix-17
Nov 3, 2026
Merged

dev-shimada merged 1 commit into
mainfrom
alert-autofix-17

Conversation

@dev-shimada

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/dev-shimada/GoStubby/security/code-scanning/17

Add an explicit permissions block at the workflow root so all jobs get least-privilege defaults, and keep/allow per-job overrides where needed (as already done in test).
Best fix here (minimal functional change): add at top level (after workflow_dispatch: and before jobs:):

  • permissions:
    • contents: read

This satisfies CodeQL and documents baseline token scope. The test job can still request id-token: write in its existing job-level block.

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>
@dev-shimada
dev-shimada marked this pull request as ready for review November 3, 2026 12:09
Copilot AI balanced review requested due to automatic review settings November 3, 2026 12:09
@dev-shimada
dev-shimada merged commit 45f38ad into main Nov 3, 2026
5 checks passed
@dev-shimada
dev-shimada deleted the alert-autofix-17 branch November 3, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the CI workflow permission change.

No open issues 🎉

What changed in this PR

Adds an explicit least-privilege token baseline to the CI workflow to address code-scanning alert #17.

Changes:

  • Sets workflow-level permissions to contents: read.
  • Preserves existing job-level permission overrides, including the test job’s id-token: write permission.
File Description
.github/​workflows/​CI.yaml Adds an explicit read-only contents permission as the workflow default.

Review effort: Balanced

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants