Npm install fails with package.json containing a private repository url with git+https #25983
-
I followed this guide: The GitHub Blog – 22 Sep 12Easier builds and deployments using Git over HTTPS and OAuth - The GitHub BlogWe first introduced OAuth2 tokens in the GitHub API starting in v3. Unlike usernames and passwords, OAuth tokens provide additional benefits: Revocable access. Tokens can be revoked at any time from a user’s settings screen and created a personal access token for my account: this is what I have in my package.json in another project:
Two strange things are happening during
Here’s my workflow file (I added
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Let me help you troubleshoot this issue.
and check the authorization token in
|
Beta Was this translation helpful? Give feedback.
-
Because this is happening on a self-hosted runner I assume I should have this configuration on the machine that hosts the actions-runner. Is that correct? |
Beta Was this translation helpful? Give feedback.
-
I suspect it is the credential stored for your git client (on your self-hosted runner machine) caused Permission denied issue when try to install your private repo. If there is no extraheader in your git config, could you please run |
Beta Was this translation helpful? Give feedback.
-
Surprisingly, this worked:
Here’s the output from the build step: After this, I didn’t try Here’s the output of
|
Beta Was this translation helpful? Give feedback.
Let me help you troubleshoot this issue.
and check the authorization token in
http.https://github.com/.extraheader=AUTHORIZATION: basic
.npm install
command directly in a run script? You could store your PAT in secrets.