Fails with git error (could not read Password)
Closed this issue · 7 comments
Using the action, we got the following error during the run:
fatal: could not read Password for 'https://***@github.com': No such device or address
(see https://github.com/JabRef/www.jabref.org/runs/683214840?check_suite_focus=true with config https://github.com/JabRef/www.jabref.org/blob/ddb2c53748ba0e89ab085aa593ad339fffc915c2/.github/workflows/publish.yml)
I guess the problem is the git user config. Maybe it works if one uses the following config taken from the github-push action:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
I also want to remark that the repo url is different in the github-push action:
https://github.com/ad-m/github-push-action/blob/master/start.sh#L27
vs
https://github.com/helaili/jekyll-action/blob/master/entrypoint.sh#L49
but I don't have enough experience to judge which version is better.
Can you try using the latest version (2.0.3
) so it at least fails properly and provide a bit more logging. Also, please use a Personal Access Token (see below) set as a secret, as opposed to the out-of-the-box GITHUB_TOKEN. Last, the git-push
action you are referring to is using a username/password pattern, whereas we're using here a Personal Access Token one.
Thanks for the quick answer. I'll re-try via the personal access token in a few days.
I don't think the git push is password based. Instead of committing as a certain user, the commits are coming from "GitHub actions". I guess that's also the reason they work reliably with GITHUB-TOKEN instead of a personal token. This might be also preferred in a organizational environment, where you usually don't want to use a personal access token in build.
See here for an example commit using git-push: JabRef/jabref@6c2fda7
I would love to be able to just rely on the GITHUB_TOKEN
but unfortunately there are some limitations to what you can do with it, and last time I check triggering Pages publishing was one of them.
Judging from the fact that the following code successfully commits to gh-pages
, I would say it is possible:
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: build
I sadly miss the experience with github actions to see how it works or provide further details. If there is something I can test, please let me know!
It was still failing with 2.0.3 (with the same error message). https://github.com/JabRef/www.jabref.org/runs/702023453
However, after switching to the personal token it worked.
Glad it works as expected 😄