Skip to content

Commit 65f56df

Browse files
committed
🤫 auth when listing git repo refs
1 parent 0aac694 commit 65f56df

File tree

1 file changed

+5
-3
lines changed
  • cyclops-ctrl/internal/template

1 file changed

+5
-3
lines changed

cyclops-ctrl/internal/template/git.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,13 @@ func clone(repoURL, commit string, creds *auth.Credentials) (billy.Filesystem, e
303303
tagPrefix := "refs/tags/"
304304
remote, err := repo.Remote(remoteName)
305305
if err != nil {
306-
panic(err)
306+
return nil, err
307307
}
308-
refList, err := remote.List(&git.ListOptions{})
308+
refList, err := remote.List(&git.ListOptions{
309+
Auth: httpBasicAuthCredentials(creds),
310+
})
309311
if err != nil {
310-
panic(err)
312+
return nil, err
311313
}
312314

313315
var reference *plumbing.Reference

0 commit comments

Comments
 (0)