Workflow set for on:release not triggering, not showing up

I’m trying out github actions, and I can’t get my action to trigger on release. The documentation says it’s supposed to trigger when a release is created, edited, and other things, but no matter what I do I can’t get it working. I’ve tried:

on: release

on: ["release"]

on:
  release:
    types: ["created","edited"]

(And, of course, created releases to try to trigger the action.) But it just won’t work! The repo is https://github.com/tkfu/homebrew-action-testing. Any ideas? Or is this just a bug?

4 Likes

I have the same issue. Nothing is triggered when a release is created.

Example:

on:  
release:  
types: [created, published]  
3 Likes

I should have posted an update. My issue was a misunderstanding of the system. The trigger only executes when a release is created using a tag that contains the workflow. I had committed my workflow to master, but was trying to trigger it using releases based on older tags, of commits that didn’t contain the workflow.

I don’t know if that happens to be the same issue you’re having @hannseman, but good luck.

I’ve done some more tests and the action is triggered when creating a release through the Github webpage but when creating a release through the API this event is not triggered. Feels like a bug no?

1 Like

Triggering a release through the API is working for me; workflows that run “on: release” are being triggered.

Are you creating a draft release?  Or a prerelease?

Are you creating a release from a GitHub Actions workflow?  If so, are you using the GITHUB_TOKEN to authenticate?  Releases created when authenticating with the GITHUB_TOKEN will prevent new workflows from running.  If you want to run new workflows, you’ll need to set up a different PAT and add that as a secret.

3 Likes

What I’m seeing is if you create a draft, and then publish that draft. The Create event never gets triggered. Surely the create event should fire whenever it gets created, regardless of the state it’s created in, no?

This is entirely through the web GUI. No idea about the API.

Perhaps the code to trigger release events need a sanity check.

2 Likes

Could you please elaborate on this by providing an example?

@tkfu wrote:

The trigger only executes when a release is created using a tag that contains the workflow.

This is the real solution, I spent far too long trying to solve this. I wish I could kiss your head, thank you