How can I stop my github action being fired 3 times when I create a new release?

This is my first post in this community, if I do something wrong kindly tell me please.


To the issue:
I have a action that is fired each time I create a new release in my repository. The code for that looks like this:

on:
  release:
  workflow_dispatch:

I also want to be able to fire the action manually, that is why I also have the workflow_dispatch in there.

Now the action does what it should - it fires as soon as I create a new release. The problem is, that it fires the action three times at the exact same time. I only create 1 release, the action is fired three times.

You can see the entire code for the action here.

Is there any code I could add to solve this issue?

on: release triggers on all event types by default. You can limit it to e.g. published:

on:
  release:
    types: [published]

Also see the docs: Events that trigger workflows - GitHub Docs

1 Like

Thank you very much, that is exactly what I needed.

1 Like