Publishing on PR
shibdib opened this issue · 1 comments
shibdib commented
Having an issue where it's publishing when a version bump is in an unmerged PR
JamesMessinger commented
It's up to you to write your GitHub Actions workflow so that it only runs when you want it to. For example, you could use the branches
keyword to limit your workflow to only running on pushes to the master
branch, like this:
on:
push:
branches:
- master
Or, if you want most of your workflow to run, but only want to run the publish step on master
, then you can use the if
keyword, like this:
steps:
- name: Publish to NPM
if: github.ref == 'refs/heads/master'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}