Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
tag

GitHub Action

Get current git tag

v1.0.1

Get current git tag

tag

Get current git tag

Get tag name from GITHUB_REF environment variable

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get current git tag

uses: devops-actions/action-get-tag@v1.0.1

Learn more about this action in devops-actions/action-get-tag

Choose a version

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.1
  with:
    # Optionally strip `v` prefix
    strip_v: true
- name: Use tag
  run: echo ${{steps.tag.outputs.tag}}