1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-10-30 23:58:09 +02:00

fix: log which token will be used (#3665)

this just helps debugging issues like #3661

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

View File

@@ -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
}