Skip to content

Commit 332ee30

Browse files
committed
fix(tests): Escape branches with special chars
Signed-off-by: spbsoluble <[email protected]>
1 parent 2b95be2 commit 332ee30

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/storeTypes_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package cmd
1717
import (
1818
"encoding/json"
1919
"fmt"
20+
"net/url"
2021
"os"
2122
"strings"
2223
"testing"
@@ -161,7 +162,9 @@ func Test_StoreTypesCreateFromTemplatesCmd(t *testing.T) {
161162
if isGhAction == "true" {
162163
ghBranch := os.Getenv("GITHUB_REF")
163164
ghBranch = strings.Replace(ghBranch, "refs/heads/", "", 1)
164-
testArgs = append(testArgs, "--git-ref", ghBranch)
165+
// url escape the branch name
166+
ghBranch = url.QueryEscape(ghBranch)
167+
testArgs = append(testArgs, "--git-ref", fmt.Sprintf("'%s'", ghBranch))
165168
t.Log("GITHUB_REF: ", ghBranch)
166169
}
167170
t.Log("testArgs: ", testArgs)

0 commit comments

Comments
 (0)