From 5b45039878184048d63b408770ac70e924aa4230 Mon Sep 17 00:00:00 2001 From: sudo Date: Wed, 19 Aug 2026 15:19:36 +0800 Subject: [PATCH 1/2] Document on.merge_group branches and branches-ignore filters --- .../events-that-trigger-workflows.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md b/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md index 0734cdc180c9..f893dd588573 100644 --- a/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md +++ b/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md @@ -394,6 +394,28 @@ on: types: [checks_requested] ``` + +You can use the `branches` and `branches-ignore` filters with `merge_group` to only run a workflow when the merge group targets specific branches. For more information, see [AUTOTITLE](/actions/reference/workflows-and-actions/workflow-syntax#onpull_requestpull_request_targetbranchesbranches-ignore). + +For example, you can run a workflow only when the merge group targets the `main` branch. + +```yaml +on: + merge_group: + branches: [ "main" ] + types: [checks_requested] +``` + +You can also use `branches-ignore` to skip a specific branch. + +```yaml +on: + merge_group: + branches-ignore: [ "main" ] + types: [checks_requested] +``` + + ## `milestone` | Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` | From 4b9a4bcc5545c5fd12232fb8337f23395b33e989 Mon Sep 17 00:00:00 2001 From: sudo Date: Wed, 19 Aug 2026 15:21:12 +0800 Subject: [PATCH 2/2] Fix consecutive blank lines (markdownlint MD012) --- .../workflows-and-actions/events-that-trigger-workflows.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md b/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md index f893dd588573..26e2527aa728 100644 --- a/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md +++ b/content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md @@ -394,7 +394,6 @@ on: types: [checks_requested] ``` - You can use the `branches` and `branches-ignore` filters with `merge_group` to only run a workflow when the merge group targets specific branches. For more information, see [AUTOTITLE](/actions/reference/workflows-and-actions/workflow-syntax#onpull_requestpull_request_targetbranchesbranches-ignore). For example, you can run a workflow only when the merge group targets the `main` branch. @@ -415,7 +414,6 @@ on: types: [checks_requested] ``` - ## `milestone` | Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` | @@ -1300,5 +1298,3 @@ jobs: body: 'Thank you for the PR!' }); ``` - -