nerdexam
Microsoft

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

Author and Maintain Workflows

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)
  • A
    2% (1)
  • B
    4% (2)
  • C
    7% (4)
  • D
    87% (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

#GitHub API#Workflow Events#External Triggers#repository_dispatch

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice