You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Execute a github workflow manually
2
2
3
+
Below are several examples for how to kick off workflow jobs manually via curl (or any external event)
4
+
3
5
## Create workflow at .github/workflows/file.yml
4
6
5
7
Notice the `event_type`[matches](https://github.com/drewmullen/actions-playground/blob/fd3721ba3c8350995a77c570fbf3a0e0fb1c2724/.github/workflows/external_echo.yml#L5) the workflow field: `on.repository_dispatch.types`. the workflow file name does not need to match.
6
8
7
-
## To Execute
9
+
## Execute a basic job
8
10
9
11
```bash
10
12
$ curl -XPOST -u "drewmullen" \
@@ -18,7 +20,7 @@ Enter host password for user 'drewmullen': <YOUR PAT>
18
20
19
21
## Specify a branch
20
22
21
-
`repository_dispatch` always uses master branch. To use another branch, view [this workflow](https://github.com/drewmullen/actions-playground/blob/fd3721ba3c8350995a77c570fbf3a0e0fb1c2724/.github/workflows/repo_dispatch.yml) and set `client_payload.ref`:
23
+
`repository_dispatch` always uses master branch. To use another branch, view [this workflow](https://github.com/drewmullen/actions-playground/blob/master/.github/workflows/repo_dispatch.yml) and set `client_payload.ref`:
22
24
23
25
```bash
24
26
curl -XPOST -u "drewmullen" \
@@ -32,7 +34,7 @@ curl -XPOST -u "drewmullen" \
32
34
33
35
## Condition steps to run based on input
34
36
35
-
If you'd like the same event to kick of specific jobs, use the `if`[condition](https://github.com/drewmullen/actions-playground/blob/fd3721ba3c8350995a77c570fbf3a0e0fb1c2724/.github/workflows/multi_repo_dispatch.yml).
37
+
If you'd like the same event to kick of specific jobs, use the `if`[condition](https://github.com/drewmullen/actions-playground/blob/master/.github/workflows/multi_repo_dispatch.yml).
36
38
37
39
```bash
38
40
curl -XPOST -u "drewmullen" \
@@ -44,6 +46,21 @@ curl -XPOST -u "drewmullen" \
44
46
45
47
[Example CI Output](https://github.com/drewmullen/actions-playground/runs/536598658?check_suite_focus=true)
0 commit comments