A reusable GitHub Action to trigger workflows in another repository using the repository_dispatch event.
This action allows you to broadcast custom events (with optional payloads) from one repository to another β ideal for staging deployments, cross-repo coordination, or multi-service automation.
In the target repo (e.g., app-service), add a workflow like this:
# .github/workflows/on-dispatch.yml
name: React to Repository Dispatch
on:
repository_dispatch:
types: [example-event]
jobs:
handle-event:
runs-on: ubuntu-latest
steps:
- run: |
echo "Triggered by: ${{ github.event_name }}"
echo "Branch: ${{ github.event.client_payload.branch }}"
echo "Source: ${{ github.event.client_payload.triggered_by }}"- name: Trigger dispatch in target repo
uses: saedyousef/repository-dispatch@v0.1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
owner: your-org
repo: app-service
event_type: example-event
client_payload: '{"key": "value", "key2": "value2"}'π token must be a Personal Access Token (PAT) with repo scope (especially for private repos).
| Name | Required | Description |
|---|---|---|
token |
β | π Must be a Personal Access Token (PAT) with repo scope (private repos) |
owner |
β | Owner of the target repository |
repo |
β | Name of the target repository |
event_type |
β | Custom event type to trigger in the target repo |
client_payload |
β | JSON object as a string with optional data |
This project is licensed under the MIT License. Β© 2025 Saed Yousef