mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-10 08:40:58 +00:00
fix: manage branch with slash properly
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
slug_ref() {
|
slug_ref() {
|
||||||
echo "$1" \
|
echo "$1" \
|
||||||
| tr "[:upper:]" "[:lower:]" \
|
| tr "[:upper:]" "[:lower:]" \
|
||||||
| sed -r 's#refs/.*/##;s/[~\^]+//g;s/[^a-zA-Z0-9]+/-/g;s/^-+\|-+$//g;s/^-*//;s/-*$//' \
|
| sed -r 's#refs/[^\/]*/##;s/[~\^]+//g;s/[^a-zA-Z0-9]+/-/g;s/^-+\|-+$//g;s/^-*//;s/-*$//' \
|
||||||
| cut -c1-63
|
| cut -c1-63
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
@test "Slug a feature branch" {
|
@test "Slug a feature branch" {
|
||||||
test_sluf_ref \
|
test_sluf_ref \
|
||||||
"refs/heads/feat/new_feature" \
|
"refs/heads/feat/new_feature" \
|
||||||
"new-feature"
|
"feat-new-feature"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Slug a fix branch" {
|
@test "Slug a fix branch" {
|
||||||
test_sluf_ref \
|
test_sluf_ref \
|
||||||
"refs/heads/fix/issue_number" \
|
"refs/heads/fix/issue_number" \
|
||||||
"issue-number"
|
"fix-issue-number"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Slug a simple tag" {
|
@test "Slug a simple tag" {
|
||||||
|
|||||||
Reference in New Issue
Block a user