From 1d2842c4193239f7a614b7b390d918b94a66c592 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 28 Dec 2022 10:27:17 -0300 Subject: [PATCH] fix: log which token will be used (#3665) this just helps debugging issues like #3661 Signed-off-by: Carlos A Becker --- internal/pipe/env/env.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/pipe/env/env.go b/internal/pipe/env/env.go index 58a2375b1e4..966b8b7a1ea 100644 --- a/internal/pipe/env/env.go +++ b/internal/pipe/env/env.go @@ -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 }