-
Notifications
You must be signed in to change notification settings - Fork 772
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
Use correct base url for gh auth token --hostname
#1898
Conversation
This PR is a follow-up to integrations#1854 GitHub CLI uses different base URLs in `~/.config/gh/hosts.yml`, so when we're using the standard base path of this provider, it doesn't align with how `gh` CLI stores the credentials. The following doesn't work: ``` $ gh auth token --hostname api.github.com > no oauth token ``` ... but the following does work correctly ``` $ gh auth token --hostname github.com > gh..<valid token> ``` attempted a workaround with ``` provider "github" { owner = "..." base_url = "github.com" } ``` But it didn't work as expected.
@nickfloyd @kfcampbell please review :) |
We're still working through the solution over here - join the conversation if you have time! |
Let's see.., |
@nickfloyd are we going to merge this with comments or close it? :) recent version picks up the token nicely, btw |
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.
Thanks for the additional effort here @nfx. I'm going to get this merged in and released but I think I am going to have another look at the logic here and see if I can simplify it and/or determine if there are any more edge cases that we could've missed.
Thanks again for everything here!
This PR is a follow-up to #1854
Before the change?
GitHub CLI uses different base URLs in
~/.config/gh/hosts.yml
, so when we're using the standard base path of this provider, it doesn't align with howgh
CLI stores the credentials - I think some of the recent CLI changes made this effect (orgh
was not updated for a while on my machine). The following doesn't work:... but the following does work correctly
attempted a workaround with
But it didn't work as expected.
After the change?
provider conf works:
Does this introduce a breaking change?
Please see our docs on breaking changes to help!