-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom GitHub token environment variable name #112
Support custom GitHub token environment variable name #112
Conversation
Signed-off-by: KeisukeYamashita <[email protected]>
ec68a58
to
13d4a8b
Compare
@@ -69,10 +69,11 @@ type service struct { | |||
// NewClient returns Client initialized with Config | |||
func NewClient(cfg Config) (*Client, error) { | |||
token := cfg.Token | |||
token = strings.TrimPrefix(token, "$") | |||
if token == EnvToken { | |||
token = os.Getenv(EnvToken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since now the EnvToken
is used only in testing, we can remove the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, true. Let me remove it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review, removed → e5e8b67
Signed-off-by: KeisukeYamashita <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you 💪 |
WHAT
If the token with
$
are configured, lookup the environment variable.WHY
For #111.
In current implementation, the
tfnotify
only supportsGITHUB_TOKEN
and users can't specify a environment variable of their own.