Skip to content

Fix workflow failure when no git tags exist#47

Merged
vgreg merged 1 commit intomainfrom
fix-workflow-no-tags
Jul 17, 2025
Merged

Fix workflow failure when no git tags exist#47
vgreg merged 1 commit intomainfrom
fix-workflow-no-tags

Conversation

@vgreg
Copy link
Owner

@vgreg vgreg commented Jul 17, 2025

Problem

The automated release workflow was failing with:

fatal: ambiguous argument 'v0.0.0..HEAD': unknown revision or path not in the working tree.

This happens because when there are no existing tags in the repository, the script sets LATEST_TAG="v0.0.0" as a fallback, but then tries to use git log v0.0.0..HEAD which fails since the v0.0.0 tag doesn't actually exist.

Solution

Add a check to handle the case when no tags exist:

  • If LATEST_TAG is the fallback v0.0.0, get all commits with git log --oneline --pretty=format:"%s"
  • Otherwise, use the normal git log ${LATEST_TAG}..HEAD approach

Testing

  • Logic validated for repositories with no tags
  • Should work for repositories with existing tags
  • End-to-end test by merging to main

This should fix the workflow and allow the first automated release to be created successfully.

🤖 Generated with Claude Code

The workflow was failing with 'fatal: ambiguous argument v0.0.0..HEAD' because
there are no existing tags in the repository. This fix checks if we're using
the fallback v0.0.0 tag and gets all commits instead of trying to compare
against a non-existent tag.
@vgreg vgreg merged commit adc324f into main Jul 17, 2025
1 of 2 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