Array of configurable trigger events

The documentation about the “on” keyword states:
“You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow”.

Is there a way to use an array of events and configuration maps at the same time? I suspect an “array of event types” is what I need, but I don’t know what the syntax is.

For example, I haven’t found a way to do this:

on:
- pull_request
- issue_comment:
    types: [created, edited]

Only “on: [pull_request, issue_comment]” is accepted.

Another example of something I would like to do:

on:
- push
- schedule:
  - cron: 0 10 * * *

To do this, I had to create 2 identical workflows with different trigger events.

Try

on:
 push:
 schedule:
 - cron: */15 * * * *
1 Like