Trying to figure out how in a Github organization using a private org's dependency (this case a private NPM package) and publish a new private package with a Github Action but it errors in Actions:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@wilson%monday - Not found
npm ERR! 404
npm ERR! 404 '@wilson/monday@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'tuesday'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
My npm.yml file:
name: npm
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm ci --ignore-scripts
- run: npm run build --if-present
- run: npm publish
env:
CI: true
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
I've also tried changing registry-url
to:
registry-url: 'https://npm.pkg.github.com'
package.json:
"name": "@wilson/tuesday",
"version": "1.3.7"
"publishConfig": {
"access": "restricted",
"registry": "https://npm.pkg.github.com/wilson/"
},
"dependencies": {
"@wilson/monday": "latest",
},
Closest question I could find pertaining to this: "How can I publish a private github package with github actions inside a private organization repo?".
Based on this answer I'm assuming I do not need an .npmrc in my repository.
Further research on the topic:
- Install private github package from package.json on Github Actions
- Github Actions workflow (private repo) hangs when trying to publish to packages
- How to install npm pckage from private git repoistory using a token in github actions
- Github actions, 401 unauthorized when installing a Github Package with npm or yarn
In my Github Action how can I publish a private package to NPM that uses a private dependency?