yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

Using PAT to access private repository #9049

Open Ciloe opened 2 months ago

Ciloe commented 2 months ago

Hi there !

I tried to connect to a private repository with yarn. I added this line :

package.json

"dependencies": {
  "wtd-tsx": "git+https://<PAT>:x-oauth-basic@github.com/<owner>/<repo>.git#main"
}

But I have this error in github action :

Capture d’écran 2024-04-09 à 11 26 21

I tried to do some other things :

.yarnrc

"@repeaterstore:wtd-tsx" "https://npm.pkg.github.com"

Or add PAT in secrets in the workflow

      - name: Checkout
        uses: actions/checkout@v4
        with:
          ref: ${{ inputs.ref }}

      - uses: actions/setup-node@v4.0.2
        with:
          node-version: '18'

      - name: Install for CI
        env:
          NODE_AUTH_TOKEN: ${{ secrets.PAT }}
        run: yarn

This is the PAT config :

Capture d’écran 2024-04-09 à 11 31 26

It's working fine in local

Have you got any other ideas ?