Skip to content

fix(ci): add safety check for empty git tag in check-wire-version job #783

@yodablocks

Description

@yodablocks

Problem

The check-wire-version CI job fails when git tags are empty or undefined. This commonly occurs:

  • During initial repository setup when no tags exist yet
  • When running CI on feature branches that haven't been tagged
  • In development environments without proper tag configuration

This causes the CI workflow to error out unexpectedly with "No matching tags found" errors.

Root Cause

The .github/workflows/ci.yml script attempts to validate wire version format without first checking if any git tags actually exist. The TAG=$(git describe --tags ...) command fails silently or returns an empty value, causing downstream checks to fail.

Solution

Add a conditional safety check to skip wire version format verification if no tags exist. This prevents the job from erroring out while allowing normal operation when tags are present.

Proposed Fix

Modify .github/workflows/ci.yml in the check-wire-version job to add:

# skip check if no tags exist (e.g., on initial repo setup)
if [ -z "$TAG" ]; then
  echo "No matching tags found, skipping wire format check"
  exit 0
fi

This ensures:

  1. ✅ CI workflows don't fail on repos/branches without tags
  2. ✅ Wire version format is still validated when tags are present
  3. ✅ No breaking changes to existing functionality

Reference Implementation

See working implementation: yodablocks/zksync-os-server-fixes@264b27d

The fix involves adding 6 lines to .github/workflows/ci.yml with proper error handling and user-friendly messaging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions