cli / cli/go-gh

TokenForHost returns string "oauth_token" as source when config is read from file

Open
#94 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
438
Forks
94
Avg merge
5d 13h
Merged PRs (30d)
6

Description

TokenForHost `source` return value should be a value like GH_TOKEN or GITHUB_TOKEN when the token comes from an environment variable, or a file path (e.g. `/path/to/hosts.yml`) when the value comes from a file. However, a static string `oauth_token` is returned instead of a file name: https://github.com/cli/go-gh/blob/da64a13f361b2a1b9a1eb5358b7d7eee7506f6a2/pkg/auth/auth.go#L64

Since `oauth_token` source is not useful to find out where a value comes from, printing the file name would be better.

Ref. https://github.com/cli/go-gh/pull/44

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.