Missing an example of mixed configured and not configured event #25098
-
In short, I’d like an example like this adding to https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows: If I wrote: I would get:
And the article says “Use an array when using more than one event”:
Simply change it to YAML works: But if you add more options, it fails again: So I also suggest you adding some notes and detection to the online editor about this. I didn’t learnt it from YAML syntax. I tried it out. It really puzzles me. And at this time I still don’t know what syntax it is. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
When you want to trigger a workflow in multiple events with specified options, you can use next syntax: on: pull_request: branches: - master push: branches: - master schedule: - cron: “0 0 * * *” issues: types: [opened, edited, milestoned] If you don’t want to specific options for one of those events, you can just remove the options , leave : behind the event name. on: pull_request: branches: - master push: schedule: - cron: “0 0 * * *” issues: types: [opened, edited, milestoned] |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. I mainly request GitHub to add them to the documentation in case other people encounter the same issue. |
Beta Was this translation helpful? Give feedback.
-
Sorry for misunderstanding your purpose of this ticket. I have submitted your suggestion (add mixed trigger events example in document) to appropriate engineering team . Thank you for your contribution to Github Actions. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion @imba-tjd! |
Beta Was this translation helpful? Give feedback.
-
Good news! We have added an example to the document: using multiple events with activity types or configuration |
Beta Was this translation helpful? Give feedback.
When you want to trigger a workflow in multiple events with specified options, you can use next syntax:
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: “0 0 * * *”
issues:
types: [opened, edited, milestoned]
If you don’t want to specific options for one of those events, you can just remove the options , leave : behind the event name.
on:
pull_request:
branches:
- master
push:
schedule:
- cron: “0 0 * * *”
issues:
types: [opened, edited, milestoned]