A GitHub Action that creates or updates floating version tag aliases (major, and minor unless you opt out) pointing to a reference commit, extracting version information from a tag. This action supports tags with or without the 'v' prefix and includes comprehensive logging capabilities.
- ✅ Simplified input design:
tag(required) for version extraction, optionalref-tag(defaults totag) for commit reference - ✅ Auto v-prefix handling: Automatically handles tags with or without 'v' prefix (v1.2.3 or 1.2.3)
- ✅ Floating tag support: Creates/updates major (
v2) and optional minor (v2.3) version tags - ✅ Version parsing: Extracts semantic version from tag with configurable prefix for output tags
- ✅ Prerelease handling: Optional filtering of prerelease versions
- ✅ Comprehensive logging: Basic info logging always enabled, verbose debug logging via input flag
- ✅ Git CLI integration: Uses native git commands for reliable tag operations
- name: Update Floating Tags
uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v2.3.4'
update-minor: trueThis will:
- Extract version
2.3.4from tagv2.3.4 - Create/update tag
v2pointing to the same commit asv2.3.4 - Create/update tag
v2.3pointing to the same commit asv2.3.4
- name: Update Floating Tags
uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: '2.3.4' # Works with or without 'v'
update-minor: trueUse a different commit/branch for floating tags than the version tag:
- name: Update Floating Tags
uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v2.3.4' # Extract version from this
ref-tag: 'main' # Point floating tags to this commit
update-minor: true- name: Update Floating Tags
uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v2.3.4'
update-minor: true
verbose: true # Enables detailed debug loggingname: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Update Floating Tags
uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: ${{ github.ref_name }}
update-minor: true
verbose: true
- name: Create Release
uses: LiquidLogicLabs/git-action-release@v2
with:
tag: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
tag |
The tag from which to extract version information (used to determine major/minor versions). Supports tags with or without 'v' prefix (e.g., 'v1.2.3' or '1.2.3'). Note: This is parsed for version info only - not used to find the commit when ref-tag is provided. |
Yes | - |
ref-tag |
The tag/commit that floating tags should point to (can be tag name, refs/tags/v1.2.3, or SHA). If not provided, uses the value from tag. Note: This is used ONLY to resolve the commit SHA via git rev-parse - it is never parsed for version information. |
No | Value of tag |
prefix |
Version prefix for tag names when creating floating tags | No | v |
update-minor |
Whether to update minor version tags (v1.2) alongside the major tag | No | true |
ignore-prerelease |
Whether to skip prerelease versions | No | true |
verbose |
Enable verbose debug logging. Sets ACTIONS_STEP_DEBUG=true environment variable and enables detailed debug output | No | false |
| Output | Description |
|---|---|
major-tag |
The major version tag that was created/updated (e.g., 'v2') |
minor-tag |
The minor version tag that was created/updated (e.g., 'v2.3'), if update-minor is true |
When the action creates or updates tags, the job must have contents: write. For read-only use (e.g. only reading version from an existing tag), contents: read is sufficient.
- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v1.2.3'
# update-minor defaults to true, so opt out explicitly for a major tag only
update-minor: false- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v1.2.3'
update-minor: true
# Creates/updates both v1 and v1.2- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'release-1.2.3'
prefix: 'release-'
update-minor: true
# Creates/updates release-1 and release-1.2By default, prerelease versions are ignored:
- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v2.0.0-beta.1'
# Will fail because ignore-prerelease defaults to trueTo allow prerelease versions:
- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v2.0.0-beta.1'
ignore-prerelease: false
update-minor: true
# Creates/updates v2 and v2.0 even for prereleaseImportant: When ref-tag is provided separately, prerelease tags are automatically allowed for version extraction, even when ignore-prerelease=true. This is because ref-tag is used only to find the commit, while tag is used only for version extraction:
- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: '3.23.0-d34fa4d2.ls4' # Prerelease tag for version extraction
ref-tag: '3.23-d34fa4d2-ls4' # Different tag/commit for floating tags to point to
update-minor: true
ignore-prerelease: true # Still works! ref-tag is separate, so prerelease tag is allowed
# Creates/updates v3 and v3.23 pointing to ref-tag commit- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v1.2.3' # Extract version from this tag
ref-tag: 'HEAD' # But point floating tags to HEAD
update-minor: true
# v1 and v1.2 will point to HEAD, not v1.2.3- Version Extraction: The action parses the
taginput to extract semantic version components (major, minor, patch). Note:ref-tagis never parsed for version information - it is only used to find the commit. - Commit Resolution: Resolves the commit SHA from
ref-tag(ortagifref-tagis not provided) usinggit rev-parse. This is the commit that floating tags will point to. - Prerelease Handling: If
ref-tagis provided separately (different fromtag), prerelease tags are allowed for version extraction even whenignore-prerelease=true, sinceref-tagis used only to find the commit, not for version parsing. - Tag Creation/Update: Creates or updates floating tags:
- Major tag:
{prefix}{major}(e.g.,v2) - Minor tag:
{prefix}{major}.{minor}(e.g.,v2.3) ifupdate-minoris true
- Major tag:
- Tag Push: Pushes the created/updated tags to the remote repository
The action supports standard semantic versioning formats:
v1.2.3(with v prefix)1.2.3(without v prefix)v2.0.0-beta.1(prerelease with v prefix)2.0.0-beta.1(prerelease without v prefix)v1.2.3+build.123(with build metadata)
The prefix input only affects the output floating tag names, not the parsing of the input tag.
The action provides informative logging at each step:
- Version extraction
- Commit SHA resolution
- Tag creation/update operations
- Tag push operations
Enable verbose logging by setting verbose: true:
- uses: LiquidLogicLabs/git-action-tag-floating-version@v2
with:
tag: 'v1.2.3'
verbose: trueThis enables:
- Detailed debug output via
core.debug() - Sets
ACTIONS_STEP_DEBUG=truefor GitHub Actions debug logging - Shows parsed version components, git command outputs, and intermediate steps
- The action requires
contents: writepermission to push tags - Tags are force-updated if they already exist (using
git push --force) - The action validates all inputs before execution
- Git commands are executed with proper error handling
This project is licensed under the MIT License.
This action is inspired by zyactions/update-semver, extending its functionality with:
- Simplified input design
- Auto v-prefix handling
- Comprehensive logging
- Node.js/TypeScript implementation
- Git CLI integration tests
For developers and contributors:
- Development Guide - Setup, development workflow, and contributing guidelines
- Testing Guide - Complete testing documentation, including all test scenarios
Contributions are welcome! Please see the Development Guide for information on how to contribute.