Skip to content

fix(ci): validate the dispatch tag in release.yml - #71

Merged
anoop-narang merged 2 commits into
mainfrom
fix/validate-release-dispatch-tag
Aug 11, 2026
Merged

fix(ci): validate the dispatch tag in release.yml#71
anoop-narang merged 2 commits into
mainfrom
fix/validate-release-dispatch-tag

Conversation

@anoop-narang

Copy link
Copy Markdown
Contributor

Gap I introduced in #63, caught in review of the same port to hotdata-ibis
(hotdata-dev/hotdata-ibis#44). publish.yml got a pre-checkout guard on the
dispatch input; release.yml did not, despite needing it more.

release.yml holds contents: write, and action-gh-release CREATES a tag when
tag_name does not resolve to one. So an unvalidated tag: main checks out
cleanly and then leaves refs/tags/main plus a release named for it, both needing
manual cleanup. publish.yml at worst wastes a run. The push path is constrained
by the v[0-9]* tag filter; the dispatch path had no constraint at all.

Same guard and same strict form as publish.yml, so the input contract matches in
both. sdk-python already had this -- its dispatch predates this work.

How this was found

Reviewing the same port into hotdata-ibis (hotdata-dev/hotdata-ibis#44), where a reviewer pointed out the asymmetry. Checking back here showed I'd introduced it in #63publish.yml got the guard, release.yml didn't.

sdk-python was unaffected: its workflow_dispatch predates this work and already shipped with validation, which is where I took the form from.

Risk being closed

Low likelihood — needs write access plus a deliberate typo — but the cleanup is manual and the fix is three lines.

Gap I introduced in #63, caught in review of the same port to hotdata-ibis
(hotdata-dev/hotdata-ibis#44). publish.yml got a pre-checkout guard on the
dispatch input; release.yml did not, despite needing it more.

release.yml holds contents: write, and action-gh-release CREATES a tag when
tag_name does not resolve to one. So an unvalidated `tag: main` checks out
cleanly and then leaves refs/tags/main plus a release named for it, both needing
manual cleanup. publish.yml at worst wastes a run. The push path is constrained
by the v[0-9]* tag filter; the dispatch path had no constraint at all.

Same guard and same strict form as publish.yml, so the input contract matches in
both. sdk-python already had this -- its dispatch predates this work.
@anoop-narang
anoop-narang requested a review from a team as a code owner August 11, 2026 17:19
@anoop-narang
anoop-narang requested review from shefeek-jinnah and removed request for a team August 11, 2026 17:19
Comment thread .github/workflows/release.yml
claude[bot]
claude Bot previously approved these changes Aug 11, 2026
My description claimed parity between the two workflows and it was not true. In
this repo publish.yml never gained a pre-checkout step -- #63 only switched its
existing "Verify tag matches pyproject version" check to $TAG, which runs AFTER
checkout and is looser (^v[0-9]). So `-f tag=v1.2` or `v1.2.3rc1` was accepted
there and rejected in release.yml.

Tightening publish.yml rather than loosening release.yml, since release.sh only
ever produces X.Y.Z -- it enforces ^[0-9]+\.[0-9]+\.[0-9]+$ on explicit versions,
so the strict form is the correct contract. Both workflows now validate the same
input the same way, before fetching an arbitrary ref.

The post-checkout version match stays: it catches a tag that is well-formed but
does not match pyproject.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prior nit resolved: publish.yml now carries the same strict pre-checkout guard, so both dispatch contracts accept exactly vX.Y.Z and validate before any ref is fetched. Verified the premise in scripts/release.sh:143 — explicit versions are gated on ^[0-9]+\.[0-9]+\.[0-9]+$, so the strict form matches what the release script can actually produce. Keeping the looser post-checkout version match is correct; it is still the only format check on the push path and covers the different failure of a well-formed tag that disagrees with pyproject.toml.

Note CI was still queued/in progress when this review ran, so I am not asserting anything about check results.

@anoop-narang
anoop-narang merged commit f98c313 into main Aug 11, 2026
3 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.

1 participant