Found while preparing v4.4.0 (#276). Not blocking that release — once the
version-bump PR for #276 merges, main's top header carries v4.4.0 and the
check behaves — but the failure mode is aimed squarely at the release procedure
in AGENTS.md §4.
bin/release:56 reads the changelog version with
awk '/^## / {for (i = 1; i <= NF; i++) if ($i ~ /^v[0-9]/) {print $i; exit}}' CHANGELOG.md
exit fires only when a v[0-9] field is found, so a top header without one —
## Unreleased — does not stop the scan. It falls through to the next ##
header and returns that version. The guard at :57 then compares the previous
release against Project.toml and passes, while the message at :60 ("Update
CHANGELOG.md so its first ## header matches the package version") shows the
first header is what was meant.
Both stanzas run against main at 0a8f046, where the top section was
## Unreleased:
Project.toml version: 4.3.1
CHANGELOG top version token: v4.3.1 <- from the v4.3.1 header, two sections down
notes extracted: the Unreleased section (5 bullets, "### Added" only)
So ./bin/release on that tree would not have refused. It would have reported
v4.3.1 — a tag that already exists — carrying the unreleased notes, and posted
@JuliaRegistrator register for an already-registered version. Anyone running
agent release before the version-bump PR merges hits exactly this.
Fix: move the exit out of the if, so the scan stops at the first ## line
whether or not it matched, and an unversioned top header fails the guard.
awk '/^## / {for (i = 1; i <= NF; i++) if ($i ~ /^v[0-9]/) print $i; exit}' CHANGELOG.md
Worth a test that feeds it a changelog whose top section is ## Unreleased and
asserts a non-zero exit.
Found while preparing v4.4.0 (#276). Not blocking that release — once the
version-bump PR for #276 merges,
main's top header carriesv4.4.0and thecheck behaves — but the failure mode is aimed squarely at the release procedure
in AGENTS.md §4.
bin/release:56reads the changelog version withawk '/^## / {for (i = 1; i <= NF; i++) if ($i ~ /^v[0-9]/) {print $i; exit}}' CHANGELOG.mdexitfires only when av[0-9]field is found, so a top header without one —## Unreleased— does not stop the scan. It falls through to the next##header and returns that version. The guard at
:57then compares the previousrelease against
Project.tomland passes, while the message at:60("UpdateCHANGELOG.md so its first
##header matches the package version") shows thefirst header is what was meant.
Both stanzas run against
mainat0a8f046, where the top section was## Unreleased:So
./bin/releaseon that tree would not have refused. It would have reportedv4.3.1— a tag that already exists — carrying the unreleased notes, and posted@JuliaRegistrator registerfor an already-registered version. Anyone runningagent releasebefore the version-bump PR merges hits exactly this.Fix: move the
exitout of theif, so the scan stops at the first##linewhether or not it matched, and an unversioned top header fails the guard.
awk '/^## / {for (i = 1; i <= NF; i++) if ($i ~ /^v[0-9]/) print $i; exit}' CHANGELOG.mdWorth a test that feeds it a changelog whose top section is
## Unreleasedandasserts a non-zero exit.