Skip to content
tag

GitHub Action

Get tag

v1.1.0 Latest version

Get tag

tag

Get tag

Get tag name from GITHUB_REF environment variable

Installation

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

              

- name: Get tag

uses: dawidd6/action-get-tag@v1.1.0

Learn more about this action in dawidd6/action-get-tag

Choose a version

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