GH-200 · Question #50
You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?
The correct answer is D. repository_dispatch. repository_dispatch is the event specifically designed to trigger workflows via the GitHub API from external systems. You send a POST request to the GitHub API endpoint /repos/{owner}/{repo}/dispatches with a custom event type, and any workflow listening on repository_dispatch wi
Question
You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?
Options
- Aworkflow_run
- Bdeployment
- Ccheck_suite
- Drepository_dispatch
How the community answered
(54 responses)- A2% (1)
- B4% (2)
- C7% (4)
- D87% (47)
Explanation
repository_dispatch is the event specifically designed to trigger workflows via the GitHub API from external systems. You send a POST request to the GitHub API endpoint /repos/{owner}/{repo}/dispatches with a custom event type, and any workflow listening on repository_dispatch with that event type will be triggered. workflow_run triggers based on another workflow's completion, deployment triggers on deployment activity within GitHub, and check_suite triggers on CI check activity-none of these are meant for external API-based triggers.
Topics
Community Discussion
No community discussion yet for this question.