Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Fails with git error (could not read Password) #34

Closed
tobiasdiez opened this issue May 17, 2020 · 7 comments
Closed

Fails with git error (could not read Password) #34

tobiasdiez opened this issue May 17, 2020 · 7 comments

Comments

@tobiasdiez
Copy link

tobiasdiez commented May 17, 2020

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.

@helaili
Copy link
Owner

helaili commented May 19, 2020

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.

image

@tobiasdiez
Copy link
Author

tobiasdiez commented May 19, 2020

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

@helaili
Copy link
Owner

helaili commented May 20, 2020

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.

@tobiasdiez
Copy link
Author

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

https://github.com/JabRef/www.jabref.org/blob/2f4edc79b99d6faa785895f0d3321f28b1de5599/.github/workflows/publish.yml#L17-L22

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!

@tobiasdiez
Copy link
Author

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.

@helaili
Copy link
Owner

helaili commented May 25, 2020

Glad it works as expected 😄

@helaili helaili closed this as completed May 25, 2020
@limjh16
Copy link
Contributor

limjh16 commented May 31, 2020

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.

Hey! maybe you could look at this on how to push to github pages with GITHUB_TOKEN

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants