get-tag-or-commit-id
is a GitHub Action that gets the tag name if it exists otherwise returns the commit id.
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 }}"
Name | Required | Default | Description |
---|---|---|---|
length | false |
7 | the expected length of the commit id |
Name | Description |
---|---|
id | the value of the tag or commit id |
type | the type of value (tag/pr/commit) |