Skip to content

ci: Add explicit permissions to CI workflows.#276

Merged
nedseb merged 1 commit intomainfrom
fix/workflow-permissions
Mar 28, 2026
Merged

ci: Add explicit permissions to CI workflows.#276
nedseb merged 1 commit intomainfrom
fix/workflow-permissions

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 28, 2026

Summary

Workflows without explicit permissions default to the repository's default token permissions, which may be overly broad. Setting contents: read follows the principle of least privilege.

Closes #277

Test plan

  • All three workflows updated: tests.yml, check-commits.yml, python-linter.yml
  • CI passes on this PR

Copilot AI review requested due to automatic review settings March 28, 2026 15:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens GitHub Actions security by explicitly setting minimal GITHUB_TOKEN permissions (contents: read) for the repository’s CI workflows, addressing CodeQL actions/missing-workflow-permissions alerts.

Changes:

  • Added top-level permissions: contents: read to .github/workflows/tests.yml
  • Added top-level permissions: contents: read to .github/workflows/python-linter.yml
  • Added top-level permissions: contents: read to .github/workflows/check-commits.yml

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/tests.yml Limits token permissions for mock test workflow while still allowing checkout.
.github/workflows/python-linter.yml Limits token permissions for lint workflow while still allowing checkout.
.github/workflows/check-commits.yml Limits token permissions for commitlint workflow while still allowing checkout with full history.

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

@nedseb nedseb merged commit fc94ec8 into main Mar 28, 2026
13 checks passed
@nedseb nedseb deleted the fix/workflow-permissions branch March 28, 2026 15:14
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.

ci: Add explicit permissions to CI workflows.

2 participants