WYRD/TOOLS

Tools / tagver / GitHub Action

GitHub Action

tagver ships a composite GitHub Action that downloads the prebuilt tagver binary from releases, runs it in your checkout, and exposes the calculated version and its components as step outputs.

Reference it as wyrd-company/tagver@v0.

Inputs

All inputs are optional.

InputDescriptionDefault
tag-prefixTag prefix to filter tags (e.g. v for v1.0.0)none
auto-incrementAuto-increment policy: major, minor, patchnone
default-pre-release-identifiersDefault pre-release identifiers (e.g. alpha.0)none
minimum-major-minorMinimum major.minor version constraint (e.g. 1.0)none
build-metadataBuild metadata to append to versionsnone
ignore-heightIgnore height in version calculationfalse
working-directoryWorking directory to analyze.
tagver-versionVersion of tagver to download (e.g. v0.1.0, or latest)latest

Outputs

OutputDescription
versionThe full calculated version
majorThe major version component
minorThe minor version component
patchThe patch version component
pre-releaseThe pre-release component (if any)
build-metadataThe build metadata component (if any)

Usage

Check out the full history (fetch-depth: 0) so tagver can see your tags and commit height, then read the outputs from the step’s id.

steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0

  - name: Calculate version
    id: tagver
    uses: wyrd-company/tagver@v0
    with: # all optional
      tag-prefix: 'v'
      auto-increment: patch
      default-pre-release-identifiers: 'alpha.0'
      minimum-major-minor: '1.0'
      build-metadata: ci
      ignore-height: false
      working-directory: '.'
      tagver-version: latest

  - name: Use version
    run: |
      echo "Full:           ${{ steps.tagver.outputs.version }}"
      echo "Major:          ${{ steps.tagver.outputs.major }}"
      echo "Minor:          ${{ steps.tagver.outputs.minor }}"
      echo "Patch:          ${{ steps.tagver.outputs.patch }}"
      echo "Pre-release:    ${{ steps.tagver.outputs.pre-release }}"
      echo "Build-metadata: ${{ steps.tagver.outputs.build-metadata }}"

The Action runs on Linux, macOS, and Windows runners. It selects the matching release asset for the runner’s OS and architecture, so fetch-depth: 0 on actions/checkout is the only requirement for accurate height calculation.