Skip to content

Get tag or commit id

Actions
Gets the tag name if it exists otherwise returns the commit id
v1.0.1
Latest
Star (0)

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)

Get tag or commit id 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

Gets the tag name if it exists otherwise returns the commit id
v1.0.1
Latest

Get tag or commit id 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.