From a GH action, how do you pull an NPM module from another private repo in the same org?

85 views Asked by At

From a GH action, how do you pull an NPM module from another private repo in the same org?

  1. I understand that GITHUB_TOKEN is scoped to only the repo running the action.
  2. I've read to use PAT instead

Ok, but how do you actually do it??

What are the steps. Where does it go?

There are the things I've done thus far..

- name: Install NPM Packages
        run: yarn install
        env:
          NODE_AUTH_TOKEN: ${{ secrets.PAT }}

FAIL

- name: Install NPM Packages
        run: yarn install
        env:
          _authToken: ${{ secrets.PAT }}

FAIL

- name: Install NPM Packages
        run: yarn install
        env:
          GITHUB_TOKEN: ${{ secrets.PAT }}

FAIL

- name: Install NPM Packages
        run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

FAIL

I would think this is a really common use case, I'm surprised figuring this out is so cryptic.

0

There are 0 answers