diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index af7e604..72fed98 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,7 +1,7 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages -name: Node.js Package +name: Publish package to GitHub Packages on: release: @@ -25,8 +25,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - registry-url: https://registry.npmjs.org/ + registry-url: 'https://npm.pkg.github.com' + scope: '@octocat' - run: npm ci - run: npm publish env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..195cb45 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} +@octocat:registry=https://npm.pkg.github.com +always-auth=true \ No newline at end of file