Repository navigation
Read a version from a tag that carries no v - #2
Merged
Merged
Conversation
Get version stripped "refs/tags/v" from GITHUB_REF in one go, which assumes every caller tags v1.4.3. sqlite-js tags with the bare version its Makefile reports, 1.4.3, and for such a tag the prefix does not match, so nothing was removed: VERSION became the whole refs/tags/1.4.3 and the format check in "Extract User-Facing Changelog and Generate JSON" rejected it. refs/tags/ now comes off first and a leading v after it, so 1.4.3 and v1.4.3 both read as 1.4.3. Callers that tag with a v get exactly what they got before. This was invisible until now because sqlite-js's own workflow listened for "v*.*.*" tags, which its tags never matched either, so the workflow had run once in its life, by hand. With that pattern fixed the next tag would have started this workflow and failed it here. Two things fall out of the same step: - VERSION is a shell variable now, so the URL output carries the version. It was read as a shell variable already, but only ever written to $GITHUB_OUTPUT, so the URL ended at releases/tag/ with nothing after it and the issue-closing comment linked to it. - test_version arrives through the env instead of being interpolated into the script, since the value belongs to whoever runs the dispatch. Checked against refs/tags/1.4.3, refs/tags/v1.4.3 and refs/tags/2.0.10: all three give the bare version and pass the format check. The YAML parses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Get versionstripsrefs/tags/vfromGITHUB_REFin one go:That assumes every caller tags
v1.4.3.sqliteai/sqlite-jstags with the bare version itsMakefile reports — its tags are
1.4.0,1.4.1,1.4.2,1.4.3— and forrefs/tags/1.4.3theprefix
refs/tags/vdoes not match, so nothing is removed.VERSIONbecomes the wholerefs/tags/1.4.3, and the format check inExtract User-Facing Changelog and Generate JSONrejects it:
refs/tags/now comes off first and a leadingvafter it, so both conventions read as1.4.3.Why nobody had hit it
sqlite-js's caller listened forv*.*.*tags, which its tags never matched either, so thisworkflow had run exactly once in its life — by hand, on 2026-07-21. I fixed that pattern in
sqliteai/sqlite-js#35 earlier today, which means the next tag there would have started this
workflow and failed it right here. So that fix needs this one to be any use.
Checked
GITHUB_REFrefs/tags/1.4.3refs/tags/1.4.3❌1.4.3✅refs/tags/v1.4.31.4.3✅1.4.3✅refs/tags/2.0.10refs/tags/2.0.10❌2.0.10✅All three pass the
^[0-9]+\.[0-9]+\.[0-9]+$check afterwards, and the YAML parses. Callers thattag with a
vget exactly what they got before, so this is not a behaviour change for anyonealready working.
Two things that fall out of the same step
URLoutput carried no version. It reads$VERSIONas a shell variable, but the oldcode only ever wrote
VERSION=into$GITHUB_OUTPUT, so the variable was never set and the URLended at
releases/tag/with nothing after it — visible in a real run as🔗 Release: https://github.com/sqliteai/sqlite-js/releases/tag/. The issue-closing commentlinks to that URL. Assigning
VERSIONin the shell, which the fix above needs anyway, sets it.test_versionnow arrives through theenvinstead of being interpolated straight into thescript, since the value is whatever the person running the dispatch typed.
What this does not change, on purpose
Create GitHub Releasestill buildstag_name: v${{ steps.get_version.outputs.VERSION }}. For acaller that tags with a
vthat is right, and unchanged; for a bare-tag caller it would producev1.4.3where the tag is1.4.3. It did not come up here becausesqlite-jspassescreate_release: false, and changing it would alter what existing callers publish, so it seemedbetter left to you than bundled in.
After merging
Callers pin
@v1, andv1currently points at3e48ffe, the tip ofmain. The tag has to moveto the merge commit before anyone picks this up.
🤖 Generated with Claude Code