jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
459 stars 78 forks source link

`npm ci` fails in workflows run on forks #135

Closed bexnoss closed 2 years ago

bexnoss commented 2 years ago

npm ci fails for workflow runs on forks, is there a special requirement why it should be used? Could npm install be used instead?

bexnoss commented 2 years ago

npm install seems to work fine.

pzhlkj6612 commented 2 years ago

What did the error say when you npm ci ?

bexnoss commented 2 years ago
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/actions/setup-python.git
npm ERR! 
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

It's caused by https://github.com/npm/cli/issues/2610.

NPM v7 always tries to use SSH to clone GitHub repos but in workflow runs on forks SSH isn't configured. For the internal cache PR I made it try npm ci first and fallback to npm install if that fails: https://github.com/jurplel/install-qt-action/pull/137/commits/f5b95ab6f517cb87b74ad035633b9fd0ae218b8e.

pzhlkj6612 commented 2 years ago

NPM v7 always tries to use SSH to clone GitHub repos...

I checked Previous Releases | Node.js and found that all LTS versions of node.js are not using NPM v7 (either v6 or v8). Can we solve it by using LTS node.js?

bexnoss commented 2 years ago

I think it used to work differently in NPM v6 and since NPM v7 it uses SSH for github/... versions. Apparently the version can be rewritten (https://github.com/npm/cli/issues/2610#issuecomment-914610832) to make it work though.