Skip to content

Commit 4cfe076

Browse files
committed
Add documentation on workflow_run.workflows
1 parent 1ae97f3 commit 4cfe076

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

content/actions/writing-workflows/workflow-syntax-for-github-actions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ A boolean specifying whether the secret must be supplied.
236236

237237
{% data reusables.actions.workflows.section-specifying-branches %}
238238

239+
## `on.workflow_run.workflows`
240+
241+
{% data reusables.actions.workflow-run.section-specifying.workflows %}
242+
239243
## `on.workflow_dispatch`
240244

241245
{% data reusables.actions.workflow-dispatch %}
@@ -1182,7 +1186,7 @@ Allowed expression contexts: `github`, `needs`, and `secrets`.
11821186

11831187
## Filter pattern cheat sheet
11841188

1185-
You can use special characters in path, branch, and tag filters.
1189+
You can use special characters in path, branch, tag, and workflow name filters.
11861190

11871191
* `*`: Matches zero or more characters, but does not match the `/` character. For example, `Octo*` matches `Octocat`.
11881192
* `**`: Matches zero or more of any character.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
When using the `workflow_run` event, you can specify which workflows can trigger your workflow.
3+
4+
The `workflows` filters accept glob patterns that use characters like `*`, `**`, `+`, `?`, `!` and others to match more than one workflow name. If a name contains any of these characters and you want a literal match, you need to _escape_ each of these special characters with `\`. For more information about glob patterns, see the [AUTOTITLE](/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet).
5+
6+
For example, a workflow with the following trigger will only run when the workflow named `Build` runs:
7+
8+
```yaml
9+
on:
10+
workflow_run:
11+
workflows: ["Build"]
12+
types: [requested]
13+
```
14+
15+
A workflow with the following trigger will only run when a workflow whose name starts with `Build` completed:
16+
17+
```yaml
18+
on:
19+
workflow_run:
20+
workflows: ["Build*"]
21+
types: [completed]
22+
```
23+
24+
A workflow with the following trigger will only run when the workflow named `Build C++` completed:
25+
26+
```yaml
27+
on:
28+
workflow_run:
29+
workflows: ["Build C\+\+"]
30+
types: [completed]
31+
```

0 commit comments

Comments
 (0)