mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-10 16:43:09 +00:00
feat(slug): keep period in slug variable
BREAKING CHANGE: The previous slug function is rename slug_url to be able to still use itin the subdomain of an url. Co-authored-by: Marc Schiller <m4rc.schiller@gmail.com>
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
@test "Slug master branch" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref:: master branch" {
|
||||
test_slug_ref \
|
||||
"refs/heads/master" \
|
||||
"master"
|
||||
}
|
||||
|
||||
@test "Slug a feature branch" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a feature branch" {
|
||||
test_slug_ref \
|
||||
"refs/heads/feat/new_feature" \
|
||||
"feat-new-feature"
|
||||
}
|
||||
|
||||
@test "Slug a fix branch" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a fix branch" {
|
||||
test_slug_ref \
|
||||
"refs/heads/fix/issue_number" \
|
||||
"fix-issue-number"
|
||||
}
|
||||
|
||||
@test "Slug a simple tag" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a simple tag" {
|
||||
test_slug_ref \
|
||||
"refs/tags/v1.0.0" \
|
||||
"v1-0-0"
|
||||
"v1.0.0"
|
||||
}
|
||||
|
||||
@test "Slug a complex tag" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a complex tag" {
|
||||
test_slug_ref \
|
||||
"refs/tags/product@1.0.0-rc.2" \
|
||||
"product-1-0-0-rc-2"
|
||||
"product-1.0.0-rc.2"
|
||||
}
|
||||
|
||||
@test "Slug a reference with upper case letters" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a reference with upper case letters" {
|
||||
test_slug_ref \
|
||||
"refs/heads/New_Awesome_Product" \
|
||||
"new-awesome-product"
|
||||
}
|
||||
|
||||
@test "Slug a very long name" {
|
||||
test_sluf_ref \
|
||||
@test "slug_ref: a very long name" {
|
||||
test_slug_ref \
|
||||
"refs/heads/an-awesome-Feature-Very-Very-Very-Very-Very-Very-Very-Long-moreThan63Characters" \
|
||||
"an-awesome-feature-very-very-very-very-very-very-very-long-more"
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
# Load sluf_ref function
|
||||
source entrypoint.sh > /dev/null 2>&1
|
||||
|
||||
test_sluf_ref() {
|
||||
test_slug_ref() {
|
||||
given="${1}"
|
||||
expected="${2}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user