Skip to content

Commit 4a9f4ca

Browse files
authored
Update 2c-configure-github-actions-workflow.md
1 parent 7295b90 commit 4a9f4ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

learn-pr/github/github-actions-automate-tasks/includes/2c-configure-github-actions-workflow.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ on:
7373
`repository_dispatch` is a custom event in GitHub Actions that allows external systems (or even other GitHub workflows) to manually trigger workflows by sending a POST request to the GitHub API.
7474
It enables flexible automation and integration with outside tools, scripts, or systems that need to start workflows in your repo.
7575

76-
### Use Cases
76+
### Use cases
7777
- Trigger workflows from external CI/CD tools.
7878

7979
- Coordinate multi-repo deployments (e.g., Repo A finishes build → triggers Repo B).
@@ -82,7 +82,7 @@ It enables flexible automation and integration with outside tools, scripts, or s
8282

8383
- Chain workflow executions between repositories or within monorepos.
8484

85-
### Example Workflow That Listens to repository_dispatch
85+
### Example workflow that listens to repository_dispatch
8686
```yml
8787
name: Custom Dispatch Listener
8888
@@ -99,14 +99,14 @@ jobs:
9999
echo "Event type: ${{ github.event.action }}"
100100
echo "Payload value: ${{ github.event.client_payload.env }}"
101101
```
102-
### Key Elements:
102+
### Key elements:
103103
- types: Optional. Defines custom event types like run-tests, deploy-to-prod, etc.
104104

105105
- github.event.client_payload: Access to any additional custom data passed in the dispatch event.
106106

107107
- github.event.action: Name of the event_type sent.
108108

109-
### Triggering the Event via API
109+
### Triggering the event via API
110110
You must send a POST request to the GitHub REST API v3 endpoint:
111111
```sh
112112
POST https://api.github.com/repos/OWNER/REPO/dispatches
@@ -123,7 +123,7 @@ curl -X POST \
123123
https://api.github.com/repos/OWNER/REPO/dispatches \
124124
-d '{"event_type":"run-tests","client_payload":{"env":"staging"}}'
125125
```
126-
#### Payload Structure
126+
#### Payload structure
127127
```json
128128
{
129129
"event_type": "run-tests",
@@ -140,7 +140,7 @@ curl -X POST \
140140
| `client_payload` | object | Arbitrary JSON payload to send custom data to the workflow (github.event.client_payload) | No
141141
| No |
142142

143-
#### repository_dispatch Parameters Breakdown
143+
#### Repository_dispatch parameters breakdown
144144
When making a POST request to the GitHub API endpoint, you must pass a JSON body with two main parameters:
145145
- event_type
146146
- client_payload
@@ -176,7 +176,7 @@ This is a free-form JSON object that lets you send custom data along with the di
176176
177177
```
178178

179-
##### Example Payload Breakdown
179+
##### Example payload breakdown
180180
```
181181
{
182182
"event_type": "deploy-to-prod",

0 commit comments

Comments
 (0)