diff --git a/content/actions/using-workflows/events-that-trigger-workflows.md b/content/actions/using-workflows/events-that-trigger-workflows.md index f87a628dcb..10cdf50db2 100644 --- a/content/actions/using-workflows/events-that-trigger-workflows.md +++ b/content/actions/using-workflows/events-that-trigger-workflows.md @@ -381,6 +381,27 @@ on: types: [created, deleted] ``` +### `merge_group` + +| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` | +| --------------------- | -------------- | ------------ | -------------| +| [`merge_group`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#pull_request) | n/a | Last merge commit of the pull request before it was added to the queue | Ref of the merge group `refs/heads/gh-readonly-queue/:branchName/:refName` | + +{% note %} + +**Note**: {% data reusables.pull_requests.merge-queue-beta %} + +{% endnote %} + +Runs your workflow when a pull request is added to a group for merging with merge queue. For more information see "[Merging a pull request with a merge queue](pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue)". + +For example, you can run a workflow when the `merge_group` event occurs. + +```yaml +on: + merge_group: +``` + ### `milestone` | Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` | @@ -569,7 +590,7 @@ on: {% note %} -**Note:** Workflows will not run on `pull_request` activity if the pull request has a merge conflict. The merge conflict must be resolved first. +**Note:** Workflows will not run on `pull_request` activity if the pull request has a merge conflict. The merge conflict must be resolved first. Conversely, workflows with the `pull_request_target` event will run even if the pull request has a merge conflict. Before using the `pull_request_target` trigger, you should be aware of the security risks. For more information, see [`pull_request_target`](#pull_request_target). @@ -612,7 +633,7 @@ on: pull_request: types: - opened - branches: + branches: - 'releases/**' ``` @@ -625,7 +646,7 @@ on: pull_request: types: - opened - branches: + branches: - 'releases/**' paths: - '**.js' @@ -670,7 +691,7 @@ on: pull_request: types: - opened - branches: + branches: - 'releases/**' paths: - '**.js' @@ -809,7 +830,7 @@ on: pull_request_target: types: - opened - branches: + branches: - 'releases/**' ``` @@ -822,7 +843,7 @@ on: pull_request_target: types: - opened - branches: + branches: - 'releases/**' paths: - '**.js' @@ -867,7 +888,7 @@ on: pull_request_target: types: - opened - branches: + branches: - 'releases/**' paths: - '**.js' @@ -936,7 +957,7 @@ For example, this workflow will run when someone pushes to `main` or to a branch ```yaml on: push: - branches: + branches: - 'main' - 'releases/**' ``` @@ -948,7 +969,7 @@ on: ```yaml on: push: - branches: + branches: - 'releases/**' paths: - '**.js' @@ -965,7 +986,7 @@ For example, this workflow will run when someone pushes a tag that starts with ` ```yaml on: push: - tags: + tags: - v1.** ``` @@ -989,7 +1010,7 @@ on: ```yaml on: push: - branches: + branches: - 'releases/**' paths: - '**.js' @@ -1249,29 +1270,29 @@ You can configure custom-defined input properties, default input values, and req {% data reusables.actions.inputs-vs-github-event-inputs %} {% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %} -This example defines inputs called `logLevel`, `tags`, and `environment`. You pass values for these inputs to the workflow when you run it. This workflow then prints the values to the log, using the {% ifversion actions-unified-inputs %}`inputs.logLevel`, `inputs.tags`, and `inputs.environment`{% else %}`github.event.inputs.logLevel`, `github.event.inputs.tags`, and `github.event.inputs.environment`{% endif %} context properties. +This example defines inputs called `logLevel`, `tags`, and `environment`. You pass values for these inputs to the workflow when you run it. This workflow then prints the values to the log, using the {% ifversion actions-unified-inputs %}`inputs.logLevel`, `inputs.tags`, and `inputs.environment`{% else %}`github.event.inputs.logLevel`, `github.event.inputs.tags`, and `github.event.inputs.environment`{% endif %} context properties. ```yaml -on: +on: workflow_dispatch: inputs: logLevel: - description: 'Log level' + description: 'Log level' required: true - default: 'warning' + default: 'warning' type: choice options: - info - warning - - debug + - debug tags: description: 'Test scenario tags' - required: false + required: false type: boolean environment: description: 'Environment to run tests against' type: environment - required: true + required: true jobs: log-the-inputs: @@ -1422,7 +1443,7 @@ jobs: upload: runs-on: ubuntu-latest - steps: + steps: - name: Save PR number env: PR_NUMBER: {% raw %}${{ github.event.number }}{% endraw %} diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md index 66ae966878..7989f18644 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.md @@ -47,6 +47,8 @@ on: merge_group: ``` +For more information see "[Events that trigger workflows](/actions/using-workflows/events-that-trigger-workflows)" + ### Triggering merge queue checks with other CI providers With other CI providers, you may need to update your configuration when a branch that begins with the special prefix `gh-readonly-queue/{base_branch}` is created.