1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

fix: log which token will be used ()

this just helps debugging issues like 

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2022-12-28 10:27:17 -03:00 committed by GitHub
parent a3867c8ccb
commit 1d2842c419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,6 +140,7 @@ func checkErrors(ctx *context.Context, noTokens, noTokenErrs bool, gitlabTokenEr
func loadEnv(env, path string) (string, error) {
val := os.Getenv(env)
if val != "" {
log.Infof("using token from %q", "$"+env)
return val, nil
}
path, err := homedir.Expand(path)
@ -154,6 +155,7 @@ func loadEnv(env, path string) (string, error) {
return "", err
}
defer f.Close()
log.Infof("using token from %q", path)
bts, _, err := bufio.NewReader(f).ReadLine()
return string(bts), err
}