Skip to content

Add least-privilege permissions to GitHub Actions workflows#1

Merged
mike-datacore merged 1 commit into
mainfrom
harden-workflow-permissions
May 16, 2026
Merged

Add least-privilege permissions to GitHub Actions workflows#1
mike-datacore merged 1 commit into
mainfrom
harden-workflow-permissions

Conversation

@mike-datacore
Copy link
Copy Markdown
Contributor

Summary

Resolves the 3 CodeQL "Workflow does not contain permissions" alerts (Medium) on main.

ci.yml and publish.yml ran with the default GITHUB_TOKEN permissions. This adds an explicit top-level permissions: contents: read to both — least privilege. Jobs that need more (OIDC publishing to PyPI via id-token: write, GitHub Release creation via contents: write) already declare it in their own per-job permissions blocks, which override the default.

Effect

Test plan

  • CI passes on this PR (16 required checks).
  • After merge, CodeQL re-scan auto-closes the 3 alerts.

CodeQL flagged ci.yml and publish.yml for running with the default
GITHUB_TOKEN permissions (rule: "Workflow does not contain
permissions", 3 Medium alerts). Added an explicit top-level
`permissions: contents: read` to both workflows. Jobs that genuinely
need more -- OIDC publishing to PyPI (id-token: write) and creating a
GitHub Release (contents: write) -- already declare those in their own
per-job permissions blocks, which override the least-privilege default.
@mike-datacore mike-datacore merged commit 089cab9 into main May 16, 2026
19 checks passed
@mike-datacore mike-datacore deleted the harden-workflow-permissions branch May 16, 2026 01:28
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