Unable to publish to the GitHub Registry
See original GitHub issueI’ve been following this document (and the README): https://github.community/t5/GitHub-Actions/bd-p/actions, specifically the part about cross publishing between npmjs and the GitHub registry, but I can’t seem to get it to work. This is my workflow: https://github.com/JamesIves/github-pages-deploy-action/blob/dev/.github/workflows/publish.yml
The problem I’m having is that every time I publish it says I must authenticate, except it’s providing a URL related to the npmjs registry: 401 Unauthorized - PUT https://registry.npmjs.org/github-pages-deploy-action - You must be logged in to publish packages.
This is the full log. Am I missing something here or is this a bug?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:22 (2 by maintainers)
Top Results From Across the Web
Unable to publish to GitHub Package Registry · Issue #53
I use the workflow you suggest, but the npm publish action on GitHub Package Registry doesn't work. On npmjs it works.
Read more >Unable to publish Github package #269
I am trying to setup a workflow that publishes a Github package, but I can't seem to make it work. ... But the...
Read more >Unable to publish unscoped packages to the ... - GitHub
The npm publish step in the above workflow fails with the following error: npm ERR! 401 Unauthorized - PUT https://npm.pkg.github.com/@remarkjs/ ...
Read more >Publishing to github registry fails · Issue #437 · sindresorhus/np
Description I just received access to the github package registry. When trying to use np it fails in the prerequisite stage: ❯ Prerequisite ......
Read more >Unable to publish private package · Issue #739 - GitHub
npmrc file then I get the same error running npm info locally. npm ERR! code E404 npm ERR! 404 Not Found - GET...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve managed to resolve this with my actions with the following workflow file:
https://github.com/JamesIves/github-pages-deploy-action/blob/dev/.github/workflows/publish.yml
I also added the scope to the package.json file here: https://github.com/JamesIves/github-pages-deploy-action/blob/dev/package.json#L2
It now cross publishes between npm and GitHub correctly. Thanks to everyone for their help resolving this. I’ll leave this open as I still believe this is an issue with setup-node.
My repo was having a similar issue to this one. Replacing the package name in package.json by adding the scope to it solved it for Github Package Registry.
My fix: https://github.com/jojobyte/traefikjam/blob/master/.github/workflows/node-build.yml#L40
This lets you publish to NPM with an unscoped package name and GPR with a scoped package name.