-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fatal: Could not read Username for "https://github.com", No such device or address #1644
Comments
Hi thank you for the incredibly detailed report! ✨ ✨ This is something that is often a cause of confusion for hub users: when doing operations such as
So you see, when you do Ideas how to improve the user-friendliness of this is very welcome! Also see plans for #225. |
Hi @mislav, I think there are a lot of things to improve the user-friendliness, but maybe this issue is not the best place to discuss about. My impression, is that using hub to achieve some simple operation seems just over-complicated.
Anyway let's talk about the auth error: Can you show me what is correct way to setup both hub and git authentications using the Personal Access Token ($GITHUB_TOKEN)? |
The correct way to auth with both git and hub:
|
What about adding those information somewhere inside the hub's documentation? Also I believe that the community would appreciate if we add some examples on how to perform some basic operations (authentication, create a fork, open a pull-request, etc) with hub. In case I would be happy to help. |
Adding extra documentation about this would be great, but actually implementing something like Any help around implementing this would be welcome! |
Closing this in favor of the referenced issue. Authentication should be easier and more friendly once a dedicated command for that is written. |
There's a lot of scattered information about how to properly configure hub to be used on GitHub actions. This attempts to condense this to a simplified bit of information captured in the README. See: - mislav#1644 - mislav#225
🏖️ very true words indeed! 🥇 |
Working in a jenkinsfile, the only thing that worked to be able to push changes back to the origin was this bit of groovy & embedded shell script:
Thanks for the hint! |
Add GITHUB_TOKEN to GHA environment * GITHUB_TOKEN variable is needed by run_doc_update.sh, but GHA provides variable secrets.GITHUB_TOKEN * update build.sh to pass doc_update_github_token * Setup GITHUB_TOKEN env variable in run-doc-update * use https for hub app * apply x-oauth workaroud: mislav/hub#1644
This commit partially reverts 7bb7fc0. It uses a different token because the previous one only had repo:status permissions. It took me a while to realize that we actually need both the token and the SSH key. See this comment: See here: * mislav/hub#1644 (comment) Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This commit partially reverts 7bb7fc0. It uses a different token because the previous one only had repo:status permissions. It took me a while to realize that we actually need both the token and the SSH key. See this comment: * mislav/hub#1644 (comment) Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This commit partially reverts 7bb7fc0. It uses a different token because the previous one only had repo:status permissions. It took me a while to realize that we actually need both the token and the SSH key. See this comment: * mislav/hub#1644 (comment) Additionally, fix the hub command: a pull request needs to be launched from a different fork or branch. Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This commit partially reverts 7bb7fc0. It uses a different token because the previous one only had repo:status permissions. It took me a while to realize that we actually need both the token and the SSH key. See this comment: * mislav/hub#1644 (comment) Additionally, fix the hub command: a pull request needs to be launched from a different fork or branch. Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This worked:
change $username to your username |
Hello!
Today I was doing the setup of a git automation inside a Docker container using hub and I ran into something that seems a bug.
Authentication method
Since the problem is related to an authentication problem let me give you some context before to talk about the error I have encountered.
In order to perform all the operations, I was using a personal token as mentioned in hub's man page
The part of the script that was configuring hub was looking like this:
The problem
My automation was trying to perform the following operations on a public repository:
The problem was that the push and the pull-request commands both gave me this (meaningless) error:
After a long struggling, I've then found a solution that seems a bit wired to me.
In order to be able to push on my fork I was needed to change this:
to this:
Why the $GITHUB_TOKEN environmental variable isn't enough in this situation?
The
$GITHUB_TOKEN
env var enables me to create a new repo (forking) on my account but does not give me the possibility to push on the same? Am I missing something?Info to reproduce the error
Below you can find the "complete" script that lets you reproduce the error:
First (non-working) version of my script (click on Details):
Second (working) version of my script (click on Details):
Example of Dockerfile to run the script (click on Details):
If interested you can find the whole script here.
Thank you!
The text was updated successfully, but these errors were encountered: