Repository navigation
Support private registry #363
Copy link
Copy link
Closed
Description
Activity
We need this.
Reacted by orept, Marco Barsotti and letluiThat workaround (change in the workflow) didn't work for me, the changesets action seems to still overwrite the registry URL. Any chance I can somehow force use the
npm.pkg.github.comas a registry?Reacted by Dinko MiletićUpdate - I found a way to make it work, see an example "release" workflow:
name: Release on: push: branches: [main] permissions: contents: write packages: write pull-requests: write jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Repo setup uses: ./.github/actions/repo-setup with: node-version: '18' pnpm-version: '10.10.0' - name: Configure npm auth (GitHub Packages) shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "@your-organization:registry=https://npm.pkg.github.com" > ~/.npmrc echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc echo "always-auth=true" >> ~/.npmrc - name: Build all (if present) run: pnpm -r --if-present build - name: Version & publish with Changesets uses: changesets/action@v1 with: version: pnpm changeset version publish: pnpm changeset publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The crucial step is
Configure npm auth (GitHub Packages)- it creates an.npmrcon the fly with both your custom registry and the auth token settings. The changesets action's code then falls into this case, and later appends this line to the found .npmrc, but it's not a problem - your package(s) will be published to your private registry only.Reacted by Eric Do
Metadata
Metadata
Assignees
Labels
No labels
I've encounter problem when using changesets/action when I'm using the private registry that is not npm.
Upon looking into it the problem seems to coming from the bellow line where it only check for npm registry name.
However, beside npm registry, we also have github registry and custom domain gitlab registry.
Hence I'm making the change here to address for this problem.
#362
Thank you the team for your work on maintaining this tool!