mikeal / merge-release

Automatically release all merges to master on npm.
Other
471 stars 64 forks source link

Function for not publishing on given merges to master? #10

Open trygve-lie opened 4 years ago

trygve-lie commented 4 years ago

Can we somehow make it so its possible to exclude certain merges?

What I am looking into doing is having an automatic publish when there are code / doc / dependency changes, but not doing a publish when ex dev dependencies is updated from a bot like Renovate or Greenkeeper.

mikeal commented 4 years ago

If the difference is based on the files changed you should just be able to use filtering in the actions themselves.

For something like only devDependencies changes that would be more difficult. It should certainly be possible, using either action filters or adding code to merge-release, to exclude commits from PR’s with specific labels which would work for greenkeeper PR’s.

mikeal commented 4 years ago

Did a little digging, this is all a bit dependent on your complete workflow.

As far as excluding very specific things, like if only the devDeps were changed, what you may want to do is write a Node.js script that will pass/fail based on this specific logic and publish it to npm as a CLI. You can then use npx in a shell call inside run in order to do the filter and overwrite the default action, making the entrypoint.sh only run when the filter is true.

 - run: |
    if [ npx trygveShouldPublish ]; then
      ./entrypoint.sh
    fi