mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-18 20:51:48 +00:00
fix: manage branch with slash properly
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
slug_ref() {
|
||||
echo "$1" \
|
||||
| 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
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
@test "Slug a feature branch" {
|
||||
test_sluf_ref \
|
||||
"refs/heads/feat/new_feature" \
|
||||
"new-feature"
|
||||
"feat-new-feature"
|
||||
}
|
||||
|
||||
@test "Slug a fix branch" {
|
||||
test_sluf_ref \
|
||||
"refs/heads/fix/issue_number" \
|
||||
"issue-number"
|
||||
"fix-issue-number"
|
||||
}
|
||||
|
||||
@test "Slug a simple tag" {
|
||||
|
||||
Reference in New Issue
Block a user