Skip to content

Commit 345857d

Browse files
authored
Adding verbose logging regarding SHUTTLE_GIT_TOKEN (#252)
1 parent dd19e9f commit 345857d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/git/git.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,19 @@ func GetGitPlan(
160160
}
161161

162162
var cloneArg string
163+
cloneToken := os.Getenv("SHUTTLE_GIT_TOKEN")
163164
if parsedGitPlan.Protocol == "https" {
164-
cloneToken := os.Getenv("SHUTTLE_GIT_TOKEN")
165165
if cloneToken == "" {
166166
cloneArg = "https://" + parsedGitPlan.Repository
167167
} else {
168168
cloneArg = fmt.Sprintf("https://%s@%s", cloneToken, parsedGitPlan.Repository)
169+
uii.Verboseln("Found clone token in env. Overriding clone path to %s", cloneArg)
169170
}
170171
} else if parsedGitPlan.Protocol == "ssh" {
172+
if cloneToken != "" {
173+
uii.Verboseln("Found clone token in env, but shuttle path was ssh-based. This override will not work.")
174+
}
175+
171176
cloneArg = parsedGitPlan.User + "@" + parsedGitPlan.Repository
172177
} else {
173178
panic(fmt.Sprintf("Unknown protocol '%s'", parsedGitPlan.Protocol))

0 commit comments

Comments
 (0)