Skip to content

Get current git tag

Actions
Get tag name from GITHUB_REF environment variable
v1.0.3
Latest
Verified creator
Star (6)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Forked from dawidd6/action-get-tag which has been an archived repo that I was relying on. Updated to fix issue with set-output (Deprecated).

OpenSSF Scorecard

Get tag GitHub Action

Simple Action that have only one responsibility - output tag name (parsed from GITHUB_REF environment variable).

Usage

Should be used only when actual tag is pushed, otherwise the Action will exit with an error.

on:
  push:
    tags:
      - '*'
- name: Get tag
  id: tag
  uses: devops-actions/action-get-tag@v1.0.3
  with:
    strip_v: true # Optional: Remove 'v' character from version
    default: v0.0.0 # Optional: Default version when tag not found

- name: Use tag
  run: echo ${{steps.tag.outputs.tag}}

Get current git tag is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Get tag name from GITHUB_REF environment variable
v1.0.3
Latest

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Get current git tag is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.