Erriez / action-get-tag

:gear: A GitHub Action to get the pushed tag name

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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).

Get tag GitHub Action

This is Erriez fork from devops-actions/action-get-tag which includes:

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: Erriez/action-get-tag@v1.0.1
  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}}

You can also access the tag from the env variable:

- name: Use Tag
  run: echo $GIT_TAG_NAME

About

:gear: A GitHub Action to get the pushed tag name

License:MIT License


Languages

Language:JavaScript 100.0%