I would like to run a workflow if a push/pull_request events is trigger OR when a schedule event is trigger...
Here my broken (syntax issue) .github/workflows/docker.yml:
name: Docker
on: [push, pull_request]
schedule:
# min hours day(month) month day(week)
- cron: '0 0 */5 * *'
...
Unfortunately this syntax is wrong, here the error:
Invalid workflow file
You have an error in your yaml syntax on line 3
According to the doc:
Example using multiple events with activity types or configuration
If you need to specify activity types or configuration for an event, you must configure each event separately. You must append a colon (:) to all events, including events without configuration.
ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-multiple-events-with-activity-types-or-configuration
So here we can't use a list of events...
name: Docker
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 */5 * *'
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With