Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build and upload to PyPI
on:
release:
types: [published]
push:
tags:
- "v[0-9]*.[0-9]*.[0-9]*"
- "[0-9]*.[0-9]*.[0-9]*"
Comment on lines +3 to +6
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The tag globs here are more permissive than the stated intent of only matching vX.Y.Z / X.Y.Z. In GitHub Actions globbing, [0-9]* means “a digit followed by anything”, so tags like v1.2.3-rc1, v1.2.3.4, or v1.2.3foo can still match and trigger a publish. Consider adding an early validation step (e.g., shell regex check against ^v?\d+\.\d+\.\d+$) to fail fast, or otherwise tightening the trigger so pre-release/suffixed tags don’t publish unintentionally.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +6
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Switching this workflow to run on push tag events means the job (which uses secrets.PYPI_API_TOKEN) will execute based on whatever workflow definition exists in the tagged commit. If someone with tag-push rights can create/move a matching tag, they could potentially run a modified workflow that exfiltrates the token. Consider adding a protected GitHub Environment for publishing (with required reviewers) and pulling the PyPI token from environment secrets, or otherwise gating the publish step to reduce the blast radius of tag-triggered runs.

Copilot uses AI. Check for mistakes.

jobs:
build-and-publish:
Expand Down
Loading