Skip to content

ci: add explicit least-privilege permissions to workflows#40

Merged
amavashev merged 1 commit intomainfrom
ci/explicit-workflow-permissions
Apr 19, 2026
Merged

ci: add explicit least-privilege permissions to workflows#40
amavashev merged 1 commit intomainfrom
ci/explicit-workflow-permissions

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Summary

  • CodeQL flagged actions/missing-workflow-permissions (medium) on both ci.yml and python-publish.yml.
  • ci.ymlpermissions: contents: read at the top level.
  • python-publish.ymlpermissions: contents: read at the top level. The publish-to-testpypi and publish-to-pypi jobs continue to override with id-token: write for trusted publishing.

Test plan

  • CI green on this PR.
  • After merge, confirm both medium alerts auto-close in Security tab.
  • Trusted-publishing flow still works on next tag push (publish jobs override at job level, behavior unchanged).

CodeQL (actions/missing-workflow-permissions, medium) flagged the
workflow for relying on the repository's default GITHUB_TOKEN scopes,
which can be broader than the workflow needs. Declares
`permissions: contents: read` at the top level (only checkout needs
write — and CI doesn't push). Jobs that need extra scopes (e.g.
PyPI publish with id-token: write) override at the job level.

Part of org-wide CodeQL hygiene sweep — same one-line addition in
cycles-server, cycles-server-admin, cycles-server-events,
cycles-dashboard, cycles-client-python, cycles-spring-boot-starter.
@amavashev amavashev merged commit acb7548 into main Apr 19, 2026
6 checks passed
@amavashev amavashev deleted the ci/explicit-workflow-permissions branch April 19, 2026 01:42
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