add comment with source

This commit is contained in:
TheFox0x7 2025-04-13 12:21:57 +02:00
parent 4728e74123
commit 922d965bb4
No known key found for this signature in database
GPG Key ID: 6CA33903484AF7C2

View File

@ -880,6 +880,9 @@ func (g *GithubDownloaderV3) FormatCloneURL(opts MigrateOptions, remoteAddr stri
return "", err
}
if len(opts.AuthToken) > 0 {
// "multiple tokens" are used to benefit more "API rate limit quota"
// git clone doesn't count for rate limits, so only use the first token.
// source: https://github.com/orgs/community/discussions/44515
u.User = url.UserPassword("oauth2", strings.Split(opts.AuthToken, ",")[0])
}
return u.String(), nil