-
I want to run a given workflow both on push and based on a cronjob. I assumed this to work:
However that throws with:
How can I get this to work? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
When you want to specify properties for the events you need to specify as a map instead of an array.
|
Beta Was this translation helpful? Give feedback.
-
When I try the accepted solution, the workflow editor seems to think the syntax is invalid [for having a string inside the yaml mapping vs a key with a trailing colon] (see screenshot). Is it possible that push here should instead be push:? I’ve tried using it with the colon in a quick test just now and both the push run and the schedule run executed as expected. |
Beta Was this translation helpful? Give feedback.
-
You can use
|
Beta Was this translation helpful? Give feedback.
-
Even though I’m a little late on this one, but yes
is perfectly valid YAML. It’s all about the nesting. :slight_smile: |
Beta Was this translation helpful? Give feedback.
-
but something like on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1' Does not work, and neither does: on:
workflow_dispatch
schedule:
- cron: '0 0 * * 1' any suggestion? |
Beta Was this translation helpful? Give feedback.
When you want to specify properties for the events you need to specify as a map instead of an array.