Skip to content

ci: do not run cd when a branch is created - #134

Merged
radu-mocanu merged 1 commit into
mainfrom
ci/skip-cd-on-branch-creation
Sep 3, 2026
Merged

ci: do not run cd when a branch is created#134
radu-mocanu merged 1 commit into
mainfrom
ci/skip-cd-on-branch-creation

Conversation

@radu-mocanu

Copy link
Copy Markdown
Collaborator

CD triggers on pushes to main and release/** filtered to pyproject.toml. Creating a release/* branch at a commit that touched pyproject.toml is a push that can match that filter, so the branch creation itself starts a publish run for a version that was already released.

Today PyPI rejects the duplicate upload, so the run just goes red. It is not harmless in every case: if the base commit's version bump was never actually published, branch creation would publish it from a branch nobody treated as a release.

Gate the CD entry jobs on !github.event.created. build needs lint and test, and pypi-publish needs build, so skipping the two entry jobs skips the chain. Manual workflow_dispatch runs are unaffected, since the property is absent there and evaluates as falsy.

Merging a hotfix PR into a release branch is a normal push with commits, so created is false and the publish still runs as intended.

@radu-mocanu
radu-mocanu merged commit f674fe3 into main Sep 3, 2026
10 checks passed
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