Skip to content

fix: fetch tags in agent checkout before computing next release version - #273

Merged
pelikhan merged 1 commit into
mainfrom
copilot/fix-release-version-increment-algorithm
Jul 29, 2026
Merged

fix: fetch tags in agent checkout before computing next release version#273
pelikhan merged 1 commit into
mainfrom
copilot/fix-release-version-increment-algorithm

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The create_release job was failing with fatal: tag 'v0.0.1' already exists because the agent runs in a shallow checkout (fetch-depth: 1) with no tags. git tag --list returned nothing, the fallback v0.0.0 kicked in, and the AI dutifully computed v0.0.1 — a tag that already existed.

Changes

  • create-release.md Step 1: add git fetch --tags before the tag listing command; replace git tag --sort=-version:refname | head -n 1 with sort -V | tail -n 1 (more portable across git versions and container environments)
  • create-release.lock.yml: recompiled via gh aw compile create-release --strict
# Before
PREVIOUS_TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-version:refname | head -n 1)

# After
git fetch --tags
PREVIOUS_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1)

…rkflow

The agent checkout uses fetch-depth: 1 with no tag fetching, so
`git tag --list` returned empty, falling back to v0.0.0. The AI then
computed v0.0.1 as the next patch release, but that tag already existed.

Fix: add `git fetch --tags` before the tag listing command and switch to
`sort -V` (shell version sort) which is more reliable than git's
`--sort=-version:refname` in container environments.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title fix: fetch tags before computing release version in create-release workflow fix: fetch tags in agent checkout before computing next release version Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 08:30
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 08:30
@pelikhan
pelikhan merged commit 59426c8 into main Jul 29, 2026
1 check 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