Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. GitHub Actions
  3. Get Latest Tag

Get Latest Tag

MITJavaScriptv2.0.0

A GitHub Action that retrieves the latest Git tag from a repository, with fallback and pattern matching options.

GitHubGitHub
197 stars51 forks0 contributors

What is Get Latest Tag?

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.

Target Audience

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.

Value Proposition

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.

Overview

Get the previous tag

Use Cases

Best For

  • Automating version bump workflows in CI/CD pipelines
  • Generating changelogs based on previous release tags
  • Creating GitHub milestones using previous version information
  • Semantic versioning automation with pattern matching
  • Workflows that need reliable fallback when no tags exist
  • Multi-repository workflows requiring tag retrieval from alternative directories

Not Ideal For

  • Workflows using shallow Git clones without adjusting fetch-depth, as the action requires full history to find tags
  • Projects needing advanced tag filtering with regular expressions or complex logic beyond simple glob patterns
  • Teams looking for an all-in-one release management solution rather than a modular component for tag retrieval
  • Environments where the .git directory is absent, as the action fails even with a fallback tag specified

Pros & Cons

Pros

Reliable Tag Retrieval

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.

Flexible Pattern Matching

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.

Timestamp Output

Provides both the tag and its creation timestamp as UNIX epoch, useful for time-based automation like changelog generation or milestone tracking.

Alternative Directory Support

Can search for tags in a different working directory path, enabling multi-repository workflows where Git repos are checked out in non-standard locations.

Cons

Git Dependency Limitation

Fails if the .git directory is missing, even with a fallback tag, limiting use in workflows with incomplete Git checkouts or non-standard setups.

Setup Complexity for Full History

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.

Basic Pattern Matching

Pattern support is limited to glob patterns, lacking advanced regex or query capabilities for complex tag naming conventions beyond simple wildcards.

Frequently Asked Questions

Quick Stats

Stars197
Forks51
Contributors0
Open Issues8
Last commit4 days ago
CreatedSince 2019

Tags

#hacktoberfest#semver#devops#workflow-automation#action#git#ci-cd#tag#git-tags#automation#github#github-actions#versioning

Included in

GitHub Actions27.6k
Auto-fetched 10 hours ago

Related Projects

action-tmateaction-tmate

Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself.

Stars3,580
Forks334
Last commit1 month ago
Paths FilterPaths Filter

Conditionally run actions based on files modified by PR, feature branch or pushed commits

Stars3,318
Forks387
Last commit1 month ago
Setup ssh-agentSetup ssh-agent

GitHub Action to setup `ssh-agent` with a private key

Stars1,482
Forks298
Last commit2 months ago
GitHub Actions to compile LaTeX documentsGitHub Actions to compile LaTeX documents

:octocat: GitHub Action to compile LaTeX documents

Stars1,410
Forks150
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub