Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Pilot Lvl 1
Message 1 of 4

Empty `types` Triggers All Types

I am attempting to remove all type triggers from my `release` trigger as defined here:

 

https://github.com/Mike-EEE/action-jackson/blob/9455ec604e3b1fff979de3a5378f3aa224a1ffce/.github/wor...

 

However, creating a new release seems to trigger three copies of the same job:

 

fbAYtEV

 

It would seem to me that if no types are defined in the `types` array, then no triggers should fire (since none are defined). 

 

Please let me know if I have misconfigured and/or misunderstood something.

3 Replies
GitHub Partner
Message 2 of 4

Re: Empty `types` Triggers All Types

 

If no types are defined in the `types` array , by default, all activity types trigger a workflow to run. When create a release , there are three types happened.  So three workflow runs are triggered. This is an expected behavior.

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-... 

You can limit your workflow runs to specific activity types using the types keyword.

Pilot Lvl 1
Message 3 of 4

Re: Empty `types` Triggers All Types

Thank you for the explanation @Yanjingzhu ... I am completely confused, however.

 

I am not implicitly defining any types, but rather I am explicitly defining no types.

 

If I implicitly do not define any types, I would expect all types to be enlisted.  However, if I explicitly define types -- even and especially when there are none -- I would expect the types that I have taken the time to explicitly define to be the only events that I want to enlist to trigger the workflow.

 

How does explicitly defining no types default to all types?  This seems backward and broken.

 

> You can limit your workflow runs to specific activity types using the types keyword.

 

That is exactly what I am trying to do, by explicitly defining no types, not all of them.

 

This seems and feels like a bug, but perhaps I am misunderstanding something.

GitHub Partner
Message 4 of 4

Re: Empty `types` Triggers All Types

types: [] means that no types were specified. YAML parsing is well defined. And so if you isn't specifying any types, then that's equivalent to implicitly define any types.

So:

on: release

and

on:
  release:
    types: []

are equivalent.

If you doesn't want to run your workflow on release evennt, you can remove release trigger. If you don't want this workflow to run, you can move it out of .github/workflows folder.