Co-authored-by: Ashish Keshan <ashkeshan@gmail.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
8 lines
1.2 KiB
Markdown
8 lines
1.2 KiB
Markdown
When using the `pull_request` and `pull_request_target` events, you can configure a workflow to run only for pull requests that target specific branches.
|
|
|
|
Use the `branches` filter when you want to include branch name patterns or when you want to both include and exclude branch names patterns. Use the `branches-ignore` filter when you only want to exclude branch name patterns. You cannot use both the `branches` and `branches-ignore` filters for the same event in a workflow.
|
|
|
|
If you define both `branches`/`branches-ignore` and [`paths`/`paths-ignore`](/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore), the workflow will only run when both filters are satisfied.
|
|
|
|
The `branches` and `branches-ignore` keywords accept glob patterns that use characters like `*`, `**`, `+`, `?`, `!` and others to match more than one branch 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/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet).
|