1

I would like to run the CI part of my Node / Ionic project where I just yesterday added a custom capacitor plugin - repo A.

This plugin sits in repo B.

On my dev machine I added B as

npm install https://PERSONAL_ACCESS_TOKEN@github.com/ME/B.git --save

to project A.

package.json now contains

"B": "git+https://PERSONAL_ACCESS_TOKEN@github.com/ME/B.git",

and I pushed this to my current merge request. However, the CI pipeline is telling me now:

  npm install
  shell: /usr/bin/bash -e {0}
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://***@github.com/ME/B.git
npm ERR! 
npm ERR! remote: Repository not found.
npm ERR! fatal: repository 'https://github.com/ME/B.git/' not found
npm ERR! 

Project B is a private repo. My account owns both repos and I am using my newly created Personal Access Token.

What should I check? I can pull the repo on my local, but there I am setup with my git+ssh env credentials too, so it might work just because of that...

El Dude
  • 5,020
  • 9
  • 44
  • 86

1 Answers1

0

Check first if you need your GitHub username:

 https://myGitHubUsername:PERSONAL_ACCESS_TOKEN@github.com/ME/B.git
         ^^^^^^^^^^^^^^^^^

Then, if you need the token in the git+https URL:

"How to use private GitHub repo as npm dependency" mentions the use of npm-cli-login instead:

- name: Login to GitHub private NPM registry
  env:
    CI_ACCESS_TOKEN: ${{ secrets.NAME_OF_YOUR_ACCESS_TOKEN_SECRET }}
  shell: bash
  run: |
    npm install -g npm-cli-login
    npm-cli-login -u "USERNAME" -p "${CI_ACCESS_TOKEN}" -e "EMAIL" -r "https://npm.pkg.github.com" -s "@SCOPE"
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755