Skip to content

release step: no tag found — git tag not available on release agent #88

Description

@alexhraber

Problem

The release step in .buildkite/pipeline.yml resolves the version from git tag -l \v*' --sort=-v:refname | head -1. Since the releasestep may run on a **different Buildkite agent** than thetagstep, the freshly-created tag is missing from the local checkout — resulting inno tag found` and no GitHub release being created.

Root Cause

git tag -l only lists tags present in the local repository. Buildkite agents do shallow clones (--depth=50) and do not automatically fetch the tag that was just pushed by the tag step on another agent.

Fix Applied

Added a 3-tier fallback chain in the release step (.buildkite/pipeline.yml):

  1. BUILDKITE_TAG — populated for tag-push-triggered builds (fast path).
  2. git fetch --tags origin + git tag -l — pulls remote tags into the local clone before listing them.
  3. git ls-remote --tags origin \v'`* — queries the remote directly as a final fallback (works regardless of local state).

All three tiers resolve the same tag: the one pushed by the tag step at git push origin "${VERSION}". Any should be sufficient; the multi-tier approach adds resilience against propagation delay or shallow clone edge cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions