Publish NPM Package with GitHub Actions
juffalow.com
Publish NPM Package with GitHub Actions
1–10 of 29 posts
Re: Publish NPM Package with GitHub Actions
#2Re: Publish NPM Package with GitHub Actions
#3Could something similar be used to publish an artifact to Pypi?
Re: Publish NPM Package with GitHub Actions
#4Re: Publish NPM Package with GitHub Actions
#5Could something similar be used to publish an artifact to Pypi?
It probably not the cleanest way to do it, but I liked having it "spelled out" in steps manually to play around and learn more about how to do this.
You can see my workflow in the toy repo here: https://github.com/ikornaselur/img-utils/blob/master/.github...
Re: Publish NPM Package with GitHub Actions
#6 - 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 source projects have been hacked this way in the past. This is why I keep my NPM publish entirely isolated from the Github repo. I review every PR that is submitted to me carefully, but don't want any chance of accidentally merging in a malicious PR that will compromise my NPM packages.
Re: Publish NPM Package with GitHub Actions
#7https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
Re: Publish NPM Package with GitHub Actions
#8Could something similar be used to publish an artifact to Pypi?
I really like the idea of automating this whole process. While not generic to publishing to pypi, I was playing around with this process in a toy repo I have, where it builds a Rust/Python package, creates a release on Github if I bump the version number, build the package and publishes it on Pypi. It probably not the cleanest way to do it, but I liked having it "spelled out" in steps manually to play around and lear…
(I did post this link in direct thread, copied here)
https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
Re: Publish NPM Package with GitHub Actions
#9Note 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
#10Note 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…