-
Notifications
You must be signed in to change notification settings - Fork 24
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
🐛 github: fix precedence flag vs env-var #5144
Conversation
Github provide has two authentication methods. 1. Application credentials 2. Personal access token We give precedence to the former and, if both auth methods are provided, we will output a warning. Closes #5036 Signed-off-by: Salim Afiune Maya <[email protected]>
} | ||
if token == "" && !isAppAuth { | ||
return nil, errors.New("a valid GitHub authentication is required, pass --token '<yourtoken>', set GITHUB_TOKEN environment variable or provide GitHub App credentials") | ||
} | ||
if token != "" { | ||
if isAppAuth { | ||
log.Warn().Msg("both authentication methods provided, using application credentials") |
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.
it looks like here we warn that we're going to use the application credentials but then set the token as the credential? is that correct?
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.
That is correct. We can also NOT set it, it is a noop at this time so, more like a preference.
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.
ok. i do find it confusing to set it if we're not using it, but things are working 👍
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.
Will not set it to avoid confusion. 👍🏽
Signed-off-by: Salim Afiune Maya <[email protected]>
Github provider has two authentication methods.
We give precedence to the former and, if both auth methods are provided,
we will output a warning.
Closes #5036