Skip to content

Commit afa49ab

Browse files
committed
do not set userpassword in git url
1 parent 821fbf8 commit afa49ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

envbuilder.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ func Run(ctx context.Context, options Options) error {
361361
}
362362

363363
if options.GitUsername != "" || options.GitPassword != "" {
364-
gitURL, err := url.Parse(options.GitURL)
365-
if err != nil {
366-
return fmt.Errorf("parse git url: %w", err)
367-
}
368-
gitURL.User = url.UserPassword(options.GitUsername, options.GitPassword)
369-
options.GitURL = gitURL.String()
364+
// Previously, we had been placing credentials in the URL
365+
// as well as setting githttp.BasicAuth.
366+
// This was removed as it would leak the credentials used
367+
// to clone the repo into the resulting workspace.
368+
// Users may still hard-code credentials directly into the
369+
// git URL themselves, if required.
370370

371371
cloneOpts.RepoAuth = &githttp.BasicAuth{
372372
Username: options.GitUsername,

0 commit comments

Comments
 (0)