Skip to content

Error with GitHub registery #650

@JulienKode

Description

@JulienKode

Error with GitHub registery

I have the following .yarnrc.yml

enableImmutableInstalls: false

nodeLinker: node-modules

npmScopes:
  xxx-xxx:
    npmAuthToken: "${GITHUB_TOKEN-''}"
    npmPublishRegistry: "https://npm.pkg.github.com/"

Here is the CI that I have ("translated" into GitHub Actions, I use another CI than Github)

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - XXXX

      - run: yarn install --immutable

      - run: 'yarn changeset version && yarn config set enableImmutableInstalls false && yarn install && git add yarn.lock && git commit -m "chore: update lockfile [skip-ci]" && git push --set-upstream origin master'

      - run: yarn changeset publish
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The last command yarn changeset publish fail with the following error:

🦋  error Received an unknown error code: E401 for npm info "@xxx-xxx/test-publish"
🦋  error Unable to authenticate, need: Basic realm="GitHub Package Registry"
error Command failed with exit code 1.

When I use yarn npm publish instead I can publish the package,
Did you have any idea how I can fix the issue or understand why we have it

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions