A GitHub Action that retrieves the latest Git tag from a repository, with fallback and pattern matching options.
WyriHaximus/github-action-get-previous-tag is a GitHub Action that retrieves the most recent Git tag from a repository. It solves the problem of reliably accessing version tags within CI/CD workflows, enabling automation of version-based tasks like generating next versions or creating milestones.
Developers and DevOps engineers building automated CI/CD pipelines on GitHub Actions that require version tag information for release automation, changelog generation, or milestone management.
Developers choose this action for its simplicity, fallback options, and pattern matching capabilities, making it more robust than manual Git tag parsing in workflows. It integrates seamlessly with other versioning actions in the ecosystem.
Get the previous tag
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fetches the most recent tag from Git history with fallback support, ensuring workflows don't break when no tags exist, as highlighted in the README's input section.
Supports glob patterns for filtering tags, such as semver formats (e.g., v*[0-9].*[0-9].*[0-9]), allowing precise version tag selection without manual parsing.
Provides both the tag and its creation timestamp as UNIX epoch, useful for time-based automation like changelog generation or milestone tracking.
Can search for tags in a different working directory path, enabling multi-repository workflows where Git repos are checked out in non-standard locations.
Fails if the .git directory is missing, even with a fallback tag, limiting use in workflows with incomplete Git checkouts or non-standard setups.
Requires setting fetch-depth: 0 in checkout actions to access full Git history, which can increase clone time and resource usage, as noted in the example workflow.
Pattern support is limited to glob patterns, lacking advanced regex or query capabilities for complex tag naming conventions beyond simple wildcards.