andresz1 / size-limit-action

Compare the real cost to run your JS app or lib to keep good performance in every pull request
ISC License
451 stars 84 forks source link

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

Open dcwither opened 4 years ago

dcwither commented 4 years ago

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.

andresz1 commented 4 years ago

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!

dcwither commented 4 years ago

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.

andresz1 commented 4 years ago

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!

Klemensas commented 4 years ago

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?

andresz1 commented 4 years ago

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!