GitHub Actions "release" trigger should trigger on draft releases #7118
Replies: 7 comments 1 reply
-
Would be nice if triggering workflows after a draft release was created.
|
Beta Was this translation helpful? Give feedback.
-
Neither this is fixed nor the type description is changed after a year. |
Beta Was this translation helpful? Give feedback.
-
Same Our use case is that we have a subset of tests that are expensive and only want to run them for new releases, but we want the tests to pass before we publish the release. Triggering these tests on the creation of a draft release seems like the best way to go about it. |
Beta Was this translation helpful? Give feedback.
-
+1 for this. We have a test script that checks if the version specifier hard-coded in a file matches the version being released. It would be really nice if we could run this test when a draft release is created. |
Beta Was this translation helpful? Give feedback.
-
In our case, we release so infrequently that we always need to perform tests of our release pipeline to make sure that things are still working (Something is always broken due to bit rot. You know how software is). My goal was to have the user create a Draft Release, which would trigger the pipeline to run and upload to the test PyPI server. Once the release pipeline has been verified as working, the user would publish the release and the same pipeline would upload to the production PyPI server instead. However, since GitHub As a cludgy workaround, I have tried to hack together a |
Beta Was this translation helpful? Give feedback.
-
It would be nice if it just worked as described in the WebHook events doc. I haven't tried with a Webhook, but as described in the link, it seems that the creation of a Draft Release from the UI would trigger a webhook event, but not a pipeline event. Either that or the docs are incorrect. |
Beta Was this translation helpful? Give feedback.
-
I don't think the need is to have draft trigger a release, but to get all the build and testing done before publishing. One workaround is to invert the order. Have a manually triggered action create the release (possibly in draft). If the build and tests fail, the release never exists. If it succeeds, it is automatically documented by creating a release. |
Beta Was this translation helpful? Give feedback.
-
If you look at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#release, you will see that it says "The release event is not triggered for draft releases". This is really weird, however, because it has both the "published" and "created" activity types. "created" triggers on any new release, and "published" triggers on any new release that is not a draft. There is no reason to have both of these types if you are silently discarding all draft releases. If I wanted to create a workflow that ran whenever a release was published, I would subscribe to the "published" activity. The "created" event fires when a draft release is created, and yet subscribing to this event doesn't trigger anything in this case? The behavior of the workflow trigger is inconsistent with the releases API for no particular reason.
Yes, of course I can use a pre-release instead, but pre-releases are publicly visible, which is undesirable when what you really want is a draft. It would be nice if this functionality just worked the way you would expect rather than having this weird gotcha.
Beta Was this translation helpful? Give feedback.
All reactions