Skip to content

Allow actions to specify target registry domain to publish - #309

Closed
rayriffy wants to merge 1 commit into
changesets:mainfrom
rayriffy:feat/custom-registry
Closed

Allow actions to specify target registry domain to publish#309
rayriffy wants to merge 1 commit into
changesets:mainfrom
rayriffy:feat/custom-registry

Conversation

@rayriffy

@rayriffy rayriffy commented Jul 1, 2023

Copy link
Copy Markdown

At the moment GitHub Actions will create .npmrc that only point to default's NPM registry (which is registry.npmjs.org). This actions option will allow user to change registry domain that script will create, and configure.

@changeset-bot

changeset-bot Bot commented Jul 1, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c56449

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/action Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@luisfagottani

Copy link
Copy Markdown

Hey @ImadBoumzaoued, we need this feat to be able to define a custom registry url. Can you merge this, plz!!?

@Andarist

Copy link
Copy Markdown
Member

We only create .npmrc if there is none already. The preferred solution to this is to include a preparation step like this one:

- name: Creating .npmrc
  run: |
    cat << EOF > "$HOME/.npmrc"
      //registry.npmjs.org/:_authToken=$NPM_TOKEN
    EOF
  env:
    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

You can control your target registry in the .npmrc that you create.

@luisfagottani

Copy link
Copy Markdown

That's right @Andarist, but I didin't need the home variable, just created with .npmrc path and works.

The only thing I think it's a little strange is the output from changeset warning me that doesn't exist a npm user file, even if I created an step before.

image

Otherwise, all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants