Skip to content

Commit

Permalink
fix: log which token will be used (#3665)
Browse files Browse the repository at this point in the history
this just helps debugging issues like #3661

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Dec 28, 2022
1 parent a3867c8 commit 1d2842c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pipe/env/env.go
Expand Up @@ -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)
Expand All @@ -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
}

0 comments on commit 1d2842c

Please sign in to comment.