feat(short_sha): add a shortened sha commit id

This commit is contained in:
Antoine Méausoone
2019-11-11 15:53:51 +01:00
committed by Romain Lespinasse
parent 3876a4c025
commit d77acd4f47
3 changed files with 33 additions and 0 deletions

View File

@@ -7,6 +7,12 @@ slug_ref() {
| cut -c1-63
}
short_sha(){
echo "$1" \
| cut -c1-8
}
echo ::set-env name=GITHUB_REF_SLUG::"$(slug_ref "$GITHUB_REF")"
echo ::set-env name=GITHUB_HEAD_REF_SLUG::"$(slug_ref "$GITHUB_HEAD_REF")"
echo ::set-env name=GITHUB_BASE_REF_SLUG::"$(slug_ref "$GITHUB_BASE_REF")"
echo ::set-env name=GITHUB_SHA_SHORT::"$(short_sha "$GITHUB_SHA")"