Skip to content

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

Merged
doismellburning merged 1 commit into
mainfrom
build/gha-permissions
Jun 23, 2026
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#136
doismellburning merged 1 commit into
mainfrom
build/gha-permissions

Conversation

@doismellburning

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/doismellburning/python-template/security/code-scanning/4

Add an explicit permissions block at the workflow root so all jobs inherit least-privilege token access unless overridden later. For this workflow, the minimal safe baseline is:

  • contents: read (needed for checkout and repository read access)

Edit .github/workflows/test.yml by inserting permissions: after the concurrency block (or near the top-level keys before jobs:). No imports, methods, or additional definitions are needed (YAML workflow only).

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

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@doismellburning doismellburning force-pushed the build/gha-permissions branch from 76267f1 to 77af5a0 Compare June 23, 2026 21:49
@doismellburning doismellburning marked this pull request as ready for review June 23, 2026 21:49
Copilot AI review requested due to automatic review settings June 23, 2026 21:49
@doismellburning doismellburning merged commit 9f6a633 into main Jun 23, 2026
5 checks passed
@doismellburning doismellburning deleted the build/gha-permissions branch June 23, 2026 21:50

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.

Pull request overview

Adds an explicit top-level GitHub Actions permissions block to the test workflow so jobs inherit a least-privilege GITHUB_TOKEN, addressing the referenced code scanning alert about missing workflow permissions.

Changes:

  • Introduces workflow-root permissions: configuration.
  • Sets the baseline token scope to contents: read for checkout/repo read access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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