What is `repository_dispatch` and how does it differ from `workflow_dispatch`?
IntermediateConceptTriggers & Events
Answer
repository_dispatch is a webhook you fire at the repo with a custom event_type and arbitrary client_payload JSON; every workflow listening for that type runs on the default branch. It is for cross-repo or external-system triggers ("library released, rebuild consumers"). workflow_dispatch targets one workflow, on a chosen ref, with typed inputs, and has a UI button.
gh api repos/ORG/app/dispatches -f event_type=lib-released \
-F 'client_payload[version]=2.3.0'
on:
repository_dispatch:
types: [lib-released]
More on Triggers & Events
How do you trigger a workflow on pushes to `main` and on PRs that target `main`?BeginnerWhat activity types does `pull_request` trigger on by default, and how do you add more?IntermediateHow do `branches` and `branches-ignore` filters work with globs?BeginnerHow do path filters work, and what are their limits?AdvancedHow do you trigger only on version tags, and what is the gotcha with pushing many tags?IntermediateWhat is `workflow_dispatch`, and what input types does it support?Beginner