-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Update documentation to reflect changesets publish expected environment variable #428
base: main
Are you sure you want to change the base?
docs: Update documentation to reflect changesets publish expected environment variable #428
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
I personally had to add the - uses: actions/setup-node@v4
with:
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
# and set up auth to read in from env.NODE_AUTH_TOKEN.
# Default: ''
registry-url: '' The error message:
and my setup: hyunbinseo/svelte-kitty@34a0e0a steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org # had to add this
cache: pnpm
- run: pnpm install
- uses: changesets/action@v1
with:
publish: node --run ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Indeed, adding the registry-url in the GitHub Actions workflow is a valid approach, especially for ensuring the workflow works in CI/CD environments. However, I prefer keeping the registry configuration in the package.json (e.g., under the publishConfig key), as it can simplify the configuration and make the project setup more portable. This way, you avoid hardcoding it in the workflow and ensure the configuration is applied consistently across environments. That said, both approaches are valid and situational. Just something to consider! |
Changelog
changesets publish
fixes changesets/changesets#942
Additional context
I wanted to add some background to this PR to provide better context for the reviewers to assist with the approval. The environment variable is defined by how NodeJS is set up within the GitHub Action Setup-node, which will automatically create a
.npmrc
file using this as an environment variable.Therefore, the action expects us to use this variable over others, while if you decide to create your own
.npmrc,
we will be in control. As we can see on here. Hence the documentation updated to align with the previous steps above to align with the setup-node specifications mitigating potential issues when developer use the code given in the Readme