size-limit-action icon indicating copy to clipboard operation
size-limit-action copied to clipboard

v1.3.1 Addition of `git fetch` causes failure in private repos

Open dcwither opened this issue 4 years ago • 5 comments

I recently rebased off of v1.3.1 and found that the addition of a git fetch caused a failure in my workflow.

/usr/bin/git fetch origin master --depth=1
fatal: could not read Username for 'https://github.com': No such device or address
##[error]The process '/usr/bin/git' failed with exit code 128

I'm not sure if there's something I need to add as a result of this, but thought I'd check here. Thanks!

EDIT: I think this was caused by the fact this was a private repo, and it needs to be authenticated.

I think https://github.com/github/hub/issues/1644 may provide a solution, though I haven't explored it.

dcwither avatar Jun 01 '20 17:06 dcwither

Hi @dcwither,

Thank you for opening an issue! 🙌 . You have been really helpful. I think that adding try/catch for this could be nice 🤔 . I'll do some research!

andresz1 avatar Jun 01 '20 20:06 andresz1

I did some digging as well since I ran into this issue with the same repo as before (now public) trying to publish to the gh-pages from an action.

The solution I found was you need to replace the git url with one that includes the token and actor https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git. I found this by looking at github push action, specifically start.sh line 27.

dcwither avatar Jun 02 '20 15:06 dcwither

Thank you @dcwither for the investigation and pointing into the right direction! I just merged my previous PR with the try/catch as a quick workaround and created v1.3.2. I'll try to open a PR to fix this properly soon (also found this question), maybe I'll combine it with the update review feature! I'll let you know 😉 try this version if you can 🙏 I'll label this as help wanted just in case someone wants to open a PR meanwhile!

andresz1 avatar Jun 03 '20 21:06 andresz1

The workaround did help.

update review feature

https://github.com/andresz1/size-limit-action/pull/28 is this outstanding PR the feature you're talking about? Do I understand correctly that you didn't tackle this there?

Klemensas avatar Jul 20 '20 12:07 Klemensas

Hi @Klemensas! Yep, I didn't tackle this problem there. #28 does a small refactor and add some improvements in terms of the UI of the report. So this issue still open!

andresz1 avatar Jul 21 '20 13:07 andresz1