如果 push/pull_request 事件被触发,我想运行一个工作流或当一个调度事件被触发时...
这是我的问题(语法问题).github/workflows/docker.yml
:
name: Docker
on: [push, pull_request]
schedule:
# min hours day(month) month day(week)
- cron: '0 0 */5 * *'
...
不幸的是这个语法是错误的,这里是错误:
Invalid workflow file
You have an error in your yaml syntax on line 3
最佳答案
根据文档:
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.
所以这里我们不能使用事件列表...
name: Docker
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 */5 * *'
...
关于github - 如何在 GitHub 工作流程中安排和推送/拉取请求事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63581746/