1## @file
2# Mergify YML file that automatically merges a GitHub pull request against
3# edk2-ci if all of the GitHub branch protections have passed.  It also
4# contains rules to:
5# * auto close branches that are not from an EDK II Maintainer
6# * post a comment on pull requests that have merge conflicts.
7# * post a comment on pull requests that have PatchCheck.py errors.
8#
9# Configuration Notes:
10# * Update the 'base=edk2-ci' statements with the name of the branch to merge
11#   pull requests.
12#
13# * Update the 'status-failure' statement with the name of the name of the Azure
14#   Pipelines Build that performs the EDK II Maintainer check.
15#
16# * This file must be checked into the 'default' branch of a repo.  Copies
17#   of this file on other branches of a repo are ignored by Mergify.
18#
19# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
20# SPDX-License-Identifier: BSD-2-Clause-Patent
21#
22# https://github.com/apps/mergify
23# https://doc.mergify.io/
24#
25##
26
27pull_request_rules:
28
29  - name: Automatically merge a PR when all required checks pass and 'push' label is present
30    conditions:
31      - base=master
32      - label=push
33      - author=@tianocore/edk-ii-maintainers
34      - status-success=tianocore.PatchCheck
35      - status-success=Ubuntu GCC5 PR
36      - status-success=Windows VS2019 PR
37    actions:
38      merge:
39        strict: true
40        method: rebase
41
42  - name: Automatically close a PR when all required checks pass and 'push' label is not present
43    conditions:
44      - base=master
45      - -label=push
46      - -closed
47      - status-success=tianocore.PatchCheck
48      - status-success=Ubuntu GCC5 PR
49      - status-success=Windows VS2019 PR
50      - status-success=Ubuntu GCC5 PR (FINISHED)
51      - status-success=Windows VS2019 PR (FINISHED)
52    actions:
53      close:
54        message: All checks passed. Auto close personal build.
55
56  - name: Post a comment on a PR that can not be merged due to a merge conflict
57    conditions:
58      - base=master
59      - conflict
60    actions:
61      comment:
62        message: PR can not be merged due to conflict.  Please rebase and resubmit
63
64  - name: Automatically close a PR that fails the EDK II Maintainers membership check and 'push' label is present
65    conditions:
66      - base=master
67      - label=push
68      - -author=@tianocore/edk-ii-maintainers
69    actions:
70      close:
71        message: PR submitter is not a member of the Tianocore EDK II Maintainers team
72
73  - name: Post a comment on a PR if PatchCheck fails
74    conditions:
75      - base=master
76      - status-failure=tianocore.PatchCheck
77    actions:
78      comment:
79        message: PR can not be merged due to a PatchCheck failure.  Please resolve and resubmit
80
81  - name: Post a comment on a PR if Ubuntu GCC5 fails
82    conditions:
83      - base=master
84      - status-failure=Ubuntu GCC5 PR
85      - status-success=Ubuntu GCC5 PR (FAILED)
86    actions:
87      comment:
88        message: PR can not be merged due to an Ubuntu GCC5 failure.  Please resolve and resubmit
89
90  - name: Post a comment on a PR if Windows VS2019 fails
91    conditions:
92      - base=master
93      - status-failure=Windows VS2019 PR
94      - status-success=Windows VS2019 PR (FAILED)
95    actions:
96      comment:
97        message: PR can not be merged due to a Windows VS2019 failure.  Please resolve and resubmit
98