Skip to content

iawia002/get-tag-or-commit-id

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Get tag or commit id

CI

get-tag-or-commit-id is a GitHub Action that gets the tag name if it exists otherwise returns the commit id.

Usage

steps:
  - name: Checkout
    id: checkout
    uses: actions/checkout@v4

  - name: Get tag or commit id
    id: get-version-id
    uses: iawia002/get-tag-or-commit-id@v1
    with:
      length: 7

  - name: Print Output
    id: output
    run: echo "${{ steps.get-version-id.outputs.id }}"

Inputs

Name Required Default Description
length false 7 the expected length of the commit id

Outputs

Name Description
id the value of the tag or commit id
type the type of value (tag/pr/commit)