-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reusable Auto Merge workflow (#60)
Adds a new workflow that automatically merges pull requests in Project Mu repos under certain conditions. As automated bots pick up mundane tasks like syncing PIP module updates, submodules, files, and so on, an increasing number of pull requests can accumulate that essentially update dependencies we expect to be updated over time. In most cases, we simply care that the new update passes CI checks. This workflow is currently configured to automerge dependabot and uefibot pull requests. Files added: - `.github/workflows/AutoMerger.yml` - Reusable workflow to auto merge pull requests that meet given criteria. - `.sync/workflows/leaf/auto-merge.yml` - Leaf workflow file to auto merge pull requests in a given repo. Signed-off-by: Michael Kubacki <[email protected]>
- Loading branch information
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This workflow automatically merges pull requests under certain | ||
# conditions in Project Mu repos. | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
# For more information, see: | ||
# https://github.com/pascalgn/automerge-action | ||
|
||
name: Auto Merge Pull Request Workflow | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
auto_merge: | ||
name: Merge | ||
runs-on: ubuntu-latest | ||
|
||
# The action cannot take multiple authors right now, so call with each author | ||
# separately. | ||
strategy: | ||
matrix: | ||
author: [ "dependabot[bot]", "uefibot" ] | ||
|
||
steps: | ||
- name: Auto Merge | ||
id: auto_merge | ||
uses: pascalgn/[email protected] | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
MERGE_FILTER_AUTHOR: "${{ matrix.author }}" | ||
MERGE_FORKS: "false" # dependabot and uefibot come from local repo branches - forks not needed | ||
MERGE_LABELS: "!state:duplicate,!state:invalid,!state:needs-maintainer-feedback,!state:needs-submitter-info,!state:under-discussion,!state:wont-fix,!type:notes,!type:question" | ||
MERGE_METHOD: "squash" # Default merge method squash (instead of "merge") | ||
MERGE_REMOVE_LABELS: = "" # Do not remove any labels from a PR after merge | ||
MERGE_REQUIRED_APPROVALS: "0" # Auto merge these PRs without human reviewers involved (need to pass PR gates) | ||
MERGE_RETRIES: "6" # Check if PR status checks pass up to 6 times | ||
MERGE_RETRY_SLEEP: "10000" # Check if PR status checks are met every 10 secs (6 * 10 = check over 1 min) | ||
UPDATE_LABELS: "" # Always update these PRs if needed to merge | ||
UPDATE_METHOD: "rebase" # Default PR update method rebase (instead of "merge") | ||
UPDATE_RETRIES: "2" # Check if an update is needed up to 2 times | ||
UPDATE_RETRY_SLEEP: "30000" # Check if an update is needed every 30 secs (2 * 30 = check over ~1 min) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow automatically merges pull requests under certain conditions. | ||
# | ||
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there | ||
# instead of the file in this repo. | ||
# | ||
# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made | ||
# in the common/reusable workflow. | ||
# | ||
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops | ||
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
|
||
name: Auto Merge Pull Request | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- edited | ||
- labeled | ||
- opened | ||
- ready_for_review | ||
- reopened | ||
- synchronize | ||
- unlabeled | ||
- unlocked | ||
pull_request_review: | ||
types: | ||
- submitted | ||
check_suite: | ||
types: | ||
- completed | ||
status: {} | ||
|
||
jobs: | ||
merge_check: | ||
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters