-
Notifications
You must be signed in to change notification settings - Fork 219
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
[1.2.0] .npmrc detection depends on HOME process env #147
Comments
This is what I plan to do. The "auto" behavior that we currently implement sounds nice on the surface but there are use cases that can't be covered with this. The "manual" solution that would roughly behave as the one included in the Changesets action is basically something like this: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} So if we consider this then including the logic in the action itself to create |
Thanks for sharing, I agree with the reasoning. When we don't exactly fit in the "auto" it becomes harder to opt-out somehow. For extra info another tricky thing: Lines 59 to 62 in 898d125
If we don't actually use the npm registry, let's say only GPR instead, it still append the npm registry to the Thanks for sharing your thoughts. I really appreciate the direction your're taking. |
In theory, this shouldn't have any consequences - or at least, that is the intention there. I agree though with the raised concerns about this and I plan to address this (like it has been mentioned in the thread). |
I don't really understand what is going on, but adding that HOME environment variable fixed my So instead of having to gitignore |
Note that the |
@Andarist okay. Well in the end I did end up gitignoring |
@TeemuKoivisto FWIW This is the config I use when publishing to GPR (.npmrc contains # Automatic .npmrc generation will be removed, for now it's hard to debug
# See https://github.com/changesets/action/issues/147#issuecomment-1030597823
- name: Debug if .npmrc is present in working directory
run: |
cat ${{ github.workspace }}/.npmrc
- name: Create Release Pull Request or Publish to GPR
id: changesets
uses: changesets/[email protected]
with:
publish: yarn g:release
cwd: ${{ github.workspace }}
title: '[Release] Version packages'
env:
# See https://github.com/changesets/action/issues/147
HOME: ${{ github.workspace }}
# allows to download / query / comment packages
GITHUB_TOKEN: ${{ secrets.CHANGESET_PAT_TOKEN }}
# allows to publish packages
GITHUB_PACKAGES_TOKEN: ${{ secrets.CHANGESET_PACKAGE_PUBLISH_TOKEN }} |
I had a quite specific issue inside my GitHub action: Manually setting |
Not a big issue, but since latest release the
.npmrc
detection depends onprocess.env.HOME
.It broke our release (private repo with github private repositories). HOME was somehow changed in the previous step by our build scripts, thus
.npmrc
was wrongly recreated.Workaround
To help if someone got hit.
Fix
I would gladly send a fix (or a doc), but I'm not sure how
process.env.HOME
and the newcwd
param should behave. Otherwise as I read that.npmrc
related code will be deprecated / removed, just a note is fineThe text was updated successfully, but these errors were encountered: