https://github.com/iawia002/get-tag-or-commit-id
GitHub Action to get the tag name if it exists otherwise returns the commit id
https://github.com/iawia002/get-tag-or-commit-id
Last synced: 7 months ago
JSON representation
GitHub Action to get the tag name if it exists otherwise returns the commit id
- Host: GitHub
- URL: https://github.com/iawia002/get-tag-or-commit-id
- Owner: iawia002
- License: mit
- Created: 2023-10-16T08:37:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-01T04:29:06.000Z (over 1 year ago)
- Last Synced: 2025-01-23T14:54:41.781Z (9 months ago)
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/get-tag-or-commit-id
- Size: 1.73 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Get tag or commit id
[](https://github.com/iawia002/get-tag-or-commit-id/actions/workflows/ci.yml)
`get-tag-or-commit-id` is a GitHub Action that gets the tag name if it exists otherwise returns the commit id.
## Usage
```yaml
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) |