-
I have a repo that I would like to publish as a github npm package, for Angular. I have read and re-read the help pages, along with external tutorials, but I am stuck and getting nowhere. There are two things I just cannot understand: (1) what "action" I should use, because none of them reference an Angular module, and (2) how and where to get/put a GITHUB_TOKEN, which is apparently different than a personal token. I have created a .npmrc file, updated the package.json file and created a .github/workflows directory with a release-package.yaml file. I have no idea what to put in that file or the .npmrc. When I try to do the npm login command, it isn't clear where to get the GITHUB_TOKEN. The help pages seem to be saying not to use a personal token, but not how to create or get a GITHUB_TOKEN. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @queejie - GITHUB_TOKEN gets injected automatically for every github action job run. You just referencing it whenever you need like For example, if you want to publish it to GitHub packages (as opposite to npm registry) you'd reference it as follows: - run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} See full workflow example here - https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#example-workflow |
Beta Was this translation helpful? Give feedback.
Hi @queejie - GITHUB_TOKEN gets injected automatically for every github action job run. You just referencing it whenever you need like
${{ secrets.GITHUB_TOKEN }}
For example, if you want to publish it to GitHub packages (as opposite to npm registry) you'd reference it as follows:
See full workflow example here - https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#example-workflow