Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on on.workflow_run.workflows #37022

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ A boolean specifying whether the secret must be supplied.

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

## `on.workflow_run.workflows`

{% data reusables.actions.workflow-run.section-specifying.workflows %}

## `on.workflow_dispatch`

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

## Filter pattern cheat sheet

You can use special characters in path, branch, and tag filters.
You can use special characters in path, branch, tag, and workflow name filters.

* `*`: Matches zero or more characters, but does not match the `/` character. For example, `Octo*` matches `Octocat`.
* `**`: Matches zero or more of any character.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

When using the `workflow_run` event, you can specify which workflows can trigger your workflow.

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).

For example, a workflow with the following trigger will only run when the workflow named `Build` runs:

```yaml
on:
workflow_run:
workflows: ["Build"]
types: [requested]
```
A workflow with the following trigger will only run when a workflow whose name starts with `Build` completed:

```yaml
on:
workflow_run:
workflows: ["Build*"]
types: [completed]
```

A workflow with the following trigger will only run when the workflow named `Build C++` completed:

```yaml
on:
workflow_run:
workflows: ["Build C\+\+"]
types: [completed]
```
Loading