npmversioningpackage.jsongithub-actionsgit-tag

Github Action different between release created and published


since Github Releases are actually a Git Tags, I want to auto-upgrade my package.json version when there is a new Release (and tag), with Github Action.

I know I need to trigger a job on: release, but according to Github Actions docs I don't know if I need to trigger when created, published, both or all?

Github says:

Note: The release event is not triggered for draft releases.

And I created two pipelines: one on: release, type: created and one on: release, type: published.

Then I created a draft release, and then I published it.

Only the published pipeline triggered, and it was when I published the release.


Solution

  • My experience has been the opposite of what was described here on the forum. When tested:

    So apparently a release can be published without being created. Weird indeed. I'd go with published.