Skip to content

Potential fix for code scanning alert no. 142: Workflow does not contain permissions#1006

Merged
maartenba merged 1 commit intomainfrom
alert-autofix-142
Feb 3, 2026
Merged

Potential fix for code scanning alert no. 142: Workflow does not contain permissions#1006
maartenba merged 1 commit intomainfrom
alert-autofix-142

Conversation

@damianh
Copy link
Copy Markdown
Member

@damianh damianh commented Feb 3, 2026

Potential fix for https://github.com/DuendeSoftware/docs.duendesoftware.com/security/code-scanning/142

In general, the fix is to add an explicit permissions block to the workflow (either at the top level or per job) that grants only the minimal access needed. For this workflow, the only required permission is read access to repository contents so that actions/checkout can fetch the source code; no write operations are present.

The best way to fix this without changing functionality is to add a root-level permissions section directly under the workflow name: (or equivalently right after the on: block) specifying contents: read. Root-level permissions will apply to all jobs that don’t override them, which suits this simple single-job workflow. Specifically, in .github/workflows/ci.yml, insert:

permissions:
  contents: read

near the top of the file (e.g., after name: ci). No imports or extra definitions are needed, and no steps or job structure must change.

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

…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@damianh damianh self-assigned this Feb 3, 2026
@damianh damianh marked this pull request as ready for review February 3, 2026 12:20
@damianh damianh requested a review from maartenba February 3, 2026 12:20
@maartenba maartenba merged commit 9b60db5 into main Feb 3, 2026
7 checks passed
@maartenba maartenba deleted the alert-autofix-142 branch February 3, 2026 12:24
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