mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-29 17:41:34 +00:00
feat(short_sha): add a shortened sha commit id
This commit is contained in:
committed by
Romain Lespinasse
parent
3876a4c025
commit
d77acd4f47
19
tests/short_sha.bats
Normal file
19
tests/short_sha.bats
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
@test "Short long hash" {
|
||||
test_short_sha \
|
||||
"a35a1a486a260cfd99c5b6f8c6034a2929ba9b3f" \
|
||||
"a35a1a48"
|
||||
}
|
||||
|
||||
# Load sluf_ref function
|
||||
source entrypoint.sh > /dev/null 2>&1
|
||||
|
||||
test_short_sha(){
|
||||
given="${1}"
|
||||
expected="${2}"
|
||||
|
||||
actual="$(short_sha ${given})"
|
||||
echo "expected : [${expected}], actual : [${actual}]"
|
||||
[ "${actual}" == "${expected}" ]
|
||||
}
|
||||
Reference in New Issue
Block a user