Skip to content

Publishing on PR #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shibdib opened this issue Nov 8, 2020 · 1 comment
Closed

Publishing on PR #20

shibdib opened this issue Nov 8, 2020 · 1 comment

Comments

@shibdib
Copy link

shibdib commented Nov 8, 2020

Having an issue where it's publishing when a version bump is in an unmerged PR

@JamesMessinger
Copy link
Member

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 }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants