Skip to content

ci: skip the release instead of failing it when the version is unchanged - #259

Open
Olen wants to merge 1 commit into
mainfrom
fix/release-skip-not-fail
Open

ci: skip the release instead of failing it when the version is unchanged#259
Olen wants to merge 1 commit into
mainfrom
fix/release-skip-not-fail

Conversation

@Olen

@Olen Olen commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

release.yml now ends green and skips the release steps when the version is unchanged, instead of exiting 1.

Why

The workflow triggers on any push to main touching pyproject.toml, but only a version bump is actually a release. The tag check handled the non-release case with exit 1, so every dependency or config edit produced a red run:

success  🔍 Extract version from Poetry     → 1.2.1
failure  🔍 Check if Git tag exists         → exit 1, tag v1.2.1 exists
skipped  🏷️ Create new tag
skipped  🚀 Create GitHub Release
skipped  🏗️ Build package with Poetry
skipped  🚀 Publish to PyPI with OpenID

Six such runs today, and the same pattern back in May. The guard was working correctly — nothing was ever published, and PyPI still shows 1.2.1 from 2026-05-14 — but a benign "nothing to release" was indistinguishable from a genuinely broken release. That trains everyone to ignore red runs on the one workflow where red should mean something.

Change

The check records exists=true|false as a step output, and the tag / GitHub release / build / publish steps are gated on it.

The condition is == 'false' rather than != 'true' deliberately: if the check step ever errors without setting an output, the publish steps skip rather than proceed. Failing closed is the right default for a publish.

Behaviour

Situation Before After
pyproject.toml edited, version unchanged ❌ red, nothing published ✅ green, release steps skipped
Version bumped to a new value ✅ tag + release + publish ✅ unchanged

Testing

Workflow YAML validated and step guards confirmed:

—                                            🔍 Check if Git tag exists
steps.check_tag.outputs.exists == 'false'    🏷️ Create new tag
steps.check_tag.outputs.exists == 'false'    🚀 Create GitHub Release
steps.check_tag.outputs.exists == 'false'    🏗️ Build package with Poetry
steps.check_tag.outputs.exists == 'false'    🚀 Publish to PyPI with OpenID

Note this PR does not touch pyproject.toml, so merging it will not itself trigger the release workflow — the first real exercise will be the next pyproject.toml change to land on main.

🤖 Generated with Claude Code

The workflow triggers on any pyproject.toml push to main, but only a version
bump is a release. The tag check handled that with `exit 1`, so every
dependency or config edit produced a red run — six today alone, and the same
pattern back in May.

A benign "nothing to release" was indistinguishable from a broken release,
which trains everyone to ignore red runs on this workflow.

Record the result as a step output and gate the tag, GitHub release, build
and publish steps on it. Unchanged version now ends green with the release
steps skipped.

The condition is `== 'false'` rather than `!= 'true'` so that a check step
that errors without setting an output skips publishing rather than
proceeding.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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