-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Token deploy prompts for username #159
Comments
Update: I was looking at https://hexo.io/docs/one-command-deployment.html and I found this.
This is clear enough - I should not expect a prompt when using a token. Does that mean something is wrong with my configuration for the token, or the mechanism that reads it? |
export GITHUB_TOKEN=<token> Will it work? |
@SukkaW That shouldn't be necessary - the syntax I'm using sets the environment variable without exporting it. Works like a charm, usually. On the suspicion that the environment variable value is not found for some reason, I tried adding my token to |
So... reading the source code, I find that the token handling is exclusively implemented in this function. As far as I can see, this means that it can only be used with the config structure that has a I'll try to change my config and update this issue. |
With a different config structure it works correctly now:
I'm leaving the issue open - I guess this should either be fixed in code or documented. At this point I'm only wondering how everybody else does this? I wouldn't normally use this config structure unless I was pushing to multiple repos, which seems like an edge case to me. |
Thanks @oliversturm, I was stuck for the same issue for hours, finally it was solved by your solution! |
Thanks @oliversturm. I do believe this need an document update. As you said, it's not common case |
The @oliversturm solution does not work for me 😞
|
Thanks. I add |
Thanks @oliversturm you saved my day (lol). Thank you for your solution!!! |
Not sure why your solution did not work for me. It kept asking me for username and password. |
I think this should be the correct way of deploying the website using token, although the token unfortunately has to be concretely typed in the yaml file. |
password auth has been deprecated by github, this should really be in the main docs. |
|
thanks ur share! |
same issue |
I'm trying to deploy my hexo site to GitHub Pages. Right now I'm testing my setup locally, but I intend to use a CI setup once it works (probably using GitHub actions).
Based on the README, I included this block in my
_config.yml
:I created an access token in GitHub with the repo scope. Now I run the deployment from the command line to test it:
The site is generated and I see git messages when everything is added to the new local repo. After this, I see a prompt:
Why does this come up? Who is supposed to enter this username in a CI scenario? My local system is not configured to remember an HTTPS GitHub username, since I normally use SSH. But the CI system would obviously never know this username - how do I specify it?
(I tried using the
name
setting in the config file as a test, but that doesn't work - looking at the code, it's clearly not intended for that purpose.)I confirmed that if I enter the username manually, the password prompt appears next. At this point I have to enter the token again and everything works - but it appears that the token configuration in the config file is ignored entirely.
I'm sure I'm misunderstanding something... can anybody confirm that token deployment is supposed to work for my use case?
The text was updated successfully, but these errors were encountered: