mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-30 09:51:45 +00:00
feat(short_sha): add a shortened sha commit id
This commit is contained in:
committed by
Romain Lespinasse
parent
3876a4c025
commit
d77acd4f47
@@ -9,6 +9,9 @@ This action slug and expose some github variables.
|
||||
- remove leading and trailing `-` caracter,
|
||||
- limit the string size to 63 caracters.
|
||||
|
||||
Others `Slug`-ish commands are available:
|
||||
- `Short SHA` a variable will limit the string size to 8 caracters.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| GitHub environment variable | Slug variable |
|
||||
@@ -17,6 +20,10 @@ This action slug and expose some github variables.
|
||||
| GITHUB_HEAD_REF | GITHUB_HEAD_REF_SLUG |
|
||||
| GITHUB_BASE_REF | GITHUB_BASE_REF_SLUG |
|
||||
|
||||
| GitHub environment variable | Short variable |
|
||||
| - | - |
|
||||
| GITHUB_SHA | GITHUB_SHA_SHORT |
|
||||
|
||||
## Example usage
|
||||
|
||||
```yaml
|
||||
@@ -26,4 +33,5 @@ This action slug and expose some github variables.
|
||||
echo ${{ env.GITHUB_REF_SLUG }}
|
||||
echo ${{ env.GITHUB_HEAD_REF_SLUG }}
|
||||
echo ${{ env.GITHUB_BASE_REF_SLUG }}
|
||||
echo ${{ env.GITHUB_SHA_SHORT }}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user