setup-node: registry-url config option Ignored when pushing to GPR and NPR
Registry url seems to be ignored here https://github.com/phillmac/orbit-db-managers/blob/a50a35fca7b0d1b79871428b39deb8ecb1293edf/.github/workflows/npmpublish.yml#L40
This differs from #52 in that there’s no.npmrc
present in the repo.
It results in an error in the GPR publish step:
npm ERR! 401 Unauthorized - PUT https://registry.npmjs.org/orbit-db-managers - You must be logged in to publish packages.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 17
- Comments: 35 (1 by maintainers)
Commits related to this issue
- Update npm-publish.yml Fix publishing to GitHub Packages Registry. (see https://github.com/actions/setup-node/issues/73) — committed to jbelien/openstreetmap-calendar-widget by jbelien 4 years ago
- Update npm-publish.yml (#7) * Update npm-publish.yml Fix publishing to GitHub Packages Registry. (see https://github.com/actions/setup-node/issues/73) * Update package.json * Update package... — committed to jbelien/openstreetmap-calendar-widget by jbelien 4 years ago
- fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 — committed to synle/restapi-typescript-decorators by synle 4 years ago
- 3.1.1 fixed pipeline to push to github registry as well as npm registry 3.1.2 fixed issue with ghr due to it not knowing of which registry to use: https://github.com/actions/setup-node/issues/73 c... — committed to synle/restapi-typescript-decorators by synle 4 years ago
- Bugfix publish workflow This is a known issue: https://github.com/actions/setup-node/issues/73 — committed to jessety/encrypted-env by jessety 3 years ago
- Add publish-vsce job - Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace. - Remove the `@remarkjs` scope since VSCE doesn't like it. - Use manual `npm conf... — committed to remarkjs/vscode-remark by asbjornu 3 years ago
- Add publish-vsce job - Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace. - Remove the `@remarkjs` scope since VSCE doesn't like it. - Use manual `npm conf... — committed to remarkjs/vscode-remark by asbjornu 3 years ago
- Add publish-vsce job - Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace. - Remove the `@remarkjs` scope since VSCE doesn't like it. - Use manual `npm conf... — committed to remarkjs/vscode-remark by asbjornu 3 years ago
- Add publish-vsce job - Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace. - Remove the `@remarkjs` scope since VSCE doesn't like it. - Use manual `npm conf... — committed to remarkjs/vscode-remark by asbjornu 3 years ago
- Add publish-vsce job - Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace. - Remove the `@remarkjs` scope since VSCE doesn't like it. - Add .npmrc instead o... — committed to remarkjs/vscode-remark by asbjornu 3 years ago
- Update npm-publish.yml Add registry workaround from https://github.com/actions/setup-node/issues/73#issuecomment-642457192 — committed to raidiun/jpstruct by rob-clarke 3 years ago
- ci: Add scope to org per https://github.com/actions/setup-node/issues/73 — committed to WPMedia/github-actions-helpers by deleted user 2 years ago
- ci: Use echo registry hack https://github.com/actions/setup-node/issues/73#issuecomment-642457192 — committed to WPMedia/github-actions-helpers by deleted user 2 years ago
- Merge pull request #73 from akamai/setup-actions Add github actions for code checks — committed to krzyk/setup-node by krzyk 4 years ago
Default template from GitHub Marketplace doesn’t work for me too.
registry-url
is ignored.https://github.com/avdeev/vanilla-sharing/runs/323109179
I also encountered the same bug…
https://github.com/SachinShekhar/ss-ngrx-router-store/runs/438107309?check_suite_focus=true
This thread is 4 months old. Is GitHub Actions team aware of this issue?
But that’s why I was so confused, as I was doing previously.
Ah, that makes sense! Thank you, that’s fixed the problem - it’s publishing to both now.
For anyone else having this problem, my workaround:
package.json
can look the same as it would on NPM without a GitHub scope, publishConfig, etc.npm install
and beforenpm publish
(as otherwise it will look to install dependencies from your scope):I’m sure that some of these lines aren’t needed, but for now my yml is:
Make sure you’ve got an NPM_TOKEN secret setup, change the echo line to have your name instead of mine - and it should work.
@phillmac you may need to add your scope to the package name in
package.json
i.e."@phillmac/orbit-db-managers"
. That got the GPR publish working for me. The GitHub Packages docs mention you may need to do this and I see @affrae’s package is configured this way too.Don’t ask me why npm defaults to
https://registry.npmjs.org
if the scope isn’t in the package name though 😜@phillmac you’re missing the set scope. This has to do with how
setup-node
is working right now.Here’s what should work:
The
npm config set scope
lets npm know you want to publish to this scope and then it’ll look in the generated.npmrc
file for the@ORG_OR_USERNAME:registry
line. We’ll get this fixed but for now this will get you going.Also your package MUST be named
@ORG_OR_USERNAME/PACKAGE
or you’ll hit errors trying to publish.Hi all - here is a workflow that publishes to both NPMJS and GPR, without needing .npmrc workarounds:
Just replace
<@OWNER>
with appropriate scope (eg for me it would be@affrae
), and use your version ofnpm_token
Is working at https://github.com/affrae/fib-tools
@affrae Changed it, still no dice. It doesn’t matter what token I use when its still pushing to entirely the wrong registry: i.e. NPM instead of GitHub https://github.com/phillmac/orbit-db-managers/commit/1b71f9739038578be275dcb939ef646c63c805a7/checks?check_suite_id=295521632#step:6:28
@xeptore Thanks. I agree. I just updated
@joebowbeer/regsync
@joebowbeer, it seems it is not necessary to set the
scope
ifregistry-url
ishttps://npm.pkg.github.com
. All the checks and settingscope
to repository owner is done here: https://github.com/actions/setup-node/blob/66dfac5/src/authutil.ts#L24-L33Good question, I’m not sure. I’ll have to play around with that some more.
I was not assuming you were fibbing 😜
Unless I am missing something fundamental, the only thing I can see different is the branch you are running from. let me try and replicate that when I get a chance.