|
1 | 1 | pull_request_rules: |
2 | | -- name: auto-merge |
3 | | - description: automatic merge for main with >= 2 approved reviews, all requested reviews have given feedback, not held, and CI is successful |
4 | | - conditions: |
5 | | - - "#approved-reviews-by>=2" |
6 | | - - "#review-requested=0" |
7 | | - - "#changes-requested-reviews-by=0" |
8 | | - - or: |
9 | | - - base=main |
10 | | - - base~=^release- |
11 | | - - label!=hold |
12 | | - - label!=do-not-merge |
13 | | - - label!=needs-rebase |
| 2 | + - name: auto-merge |
| 3 | + description: automatic merge for main with >= 2 approved reviews, all requested reviews have given feedback, not held, and CI is successful |
| 4 | + conditions: |
| 5 | + - "#approved-reviews-by>=2" |
| 6 | + - "#review-requested=0" |
| 7 | + - "#changes-requested-reviews-by=0" |
| 8 | + - or: |
| 9 | + - base=main |
| 10 | + - base~=^release- |
| 11 | + - label!=hold |
| 12 | + - label!=do-not-merge |
| 13 | + - label!=needs-rebase |
14 | 14 |
|
15 | 15 | # The files conditions regex should match the globs in workflow files |
16 | 16 | # If workflow configuration files in .github/ are changed, the actionlint check must pass |
17 | | - - or: |
18 | | - - and: |
19 | | - - check-success=actionlint |
20 | | - - or: |
21 | | - - files~=^\.github/(actions|workflows)/.*\.ya?ml$ |
22 | | - - files~=^\.github/workflows/actionlint\. |
23 | | - - and: |
24 | | - - -files~=^\.github/(actions|workflows)/.*\.ya?ml$ |
25 | | - - -files~=^\.github/workflows/actionlint\. |
| 17 | + - or: |
| 18 | + - and: |
| 19 | + - check-success=actionlint |
| 20 | + - or: |
| 21 | + - files~=^\.github/(actions|workflows)/.*\.ya?ml$ |
| 22 | + - files~=^\.github/workflows/actionlint\. |
| 23 | + - and: |
| 24 | + - -files~=^\.github/(actions|workflows)/.*\.ya?ml$ |
| 25 | + - -files~=^\.github/workflows/actionlint\. |
26 | 26 |
|
27 | 27 | # e2e medium workflow |
28 | | - - or: |
29 | | - - and: |
| 28 | + - or: |
| 29 | + - and: |
30 | 30 | # note this should match the triggering criteria in 'e2e-nvidia-l4-x1.yml' |
31 | | - - check-success~=e2e-medium-workflow-complete |
32 | | - - or: |
33 | | - - files~=\.py$ |
34 | | - - files=pyproject.toml |
35 | | - - files~=^requirements.*\.txt$ |
36 | | - - files=.github/workflows/e2e-nvidia-l4-x1.yml |
37 | | - - and: |
38 | | - - -files~=\.py$ |
39 | | - - -files=pyproject.toml |
40 | | - - -files~=^requirements.*\.txt$ |
41 | | - - -files=.github/workflows/e2e-nvidia-l4-x1.yml |
| 31 | + - check-success~=e2e-medium-workflow-complete |
| 32 | + - or: |
| 33 | + - files~=\.py$ |
| 34 | + - files=pyproject.toml |
| 35 | + - files~=^requirements.*\.txt$ |
| 36 | + - files=.github/workflows/e2e-nvidia-l4-x1.yml |
| 37 | + - and: |
| 38 | + - -files~=\.py$ |
| 39 | + - -files=pyproject.toml |
| 40 | + - -files~=^requirements.*\.txt$ |
| 41 | + - -files=.github/workflows/e2e-nvidia-l4-x1.yml |
42 | 42 |
|
43 | 43 | # lint must pass if files change that would trigger this job |
44 | | - - or: |
45 | | - - and: |
46 | | - - check-success=lint-workflow-complete |
47 | | - - or: |
| 44 | + - or: |
| 45 | + - and: |
| 46 | + - check-success=lint-workflow-complete |
| 47 | + - or: |
48 | 48 | # see .github/workflows/lint.yml and test.yml |
49 | | - - files~=\.py$ |
50 | | - - files=pyproject.toml |
51 | | - - files~=^requirements.*\.txt$ |
| 49 | + - files~=\.py$ |
| 50 | + - files=pyproject.toml |
| 51 | + - files~=^requirements.*\.txt$ |
| 52 | + - files=tox.ini |
| 53 | + - files~=^scripts/[^/]+\.sh$ |
| 54 | + - files=.github/workflows/lint.yml |
| 55 | + - and: |
| 56 | + - -files~=\.py$ |
| 57 | + - -files=pyproject.toml |
| 58 | + - -files~=^requirements.*\.txt$ |
| 59 | + - -files=tox.ini |
| 60 | + - -files~=^scripts/[^/]+\.sh$ |
| 61 | + - -files=.github/workflows/lint.yml |
| 62 | + |
| 63 | + - or: |
| 64 | + - and: |
| 65 | + - check-success=markdown-lint |
| 66 | + - or: |
| 67 | + - files~=\.md$ |
| 68 | + - files=.markdownlint-cli2.yaml |
| 69 | + - files=.github/workflows/docs.yml |
| 70 | + - and: |
| 71 | + - -files~=\.md$ |
| 72 | + - -files=.markdownlint-cli2.yaml |
| 73 | + - -files=.github/workflows/docs.yml |
| 74 | + |
| 75 | + actions: |
| 76 | + merge: |
| 77 | + method: merge |
| 78 | + |
| 79 | + - name: label-cicd |
| 80 | + description: Automatically apply CI/CD label |
| 81 | + conditions: |
| 82 | + - or: |
| 83 | + - files=.github/mergify.yml |
| 84 | + - files~=^\.github/(actions|workflows)/ |
| 85 | + - files=scripts/ruff.sh |
| 86 | + - files=.pre-commit-config.yaml |
| 87 | + - files=.pylintrc |
52 | 88 | - files=tox.ini |
53 | | - - files~=^scripts/[^/]+\.sh$ |
54 | | - - files=.github/workflows/lint.yml |
55 | | - - and: |
56 | | - - -files~=\.py$ |
57 | | - - -files=pyproject.toml |
58 | | - - -files~=^requirements.*\.txt$ |
59 | | - - -files=tox.ini |
60 | | - - -files~=^scripts/[^/]+\.sh$ |
61 | | - - -files=.github/workflows/lint.yml |
62 | | - |
63 | | - - or: |
64 | | - - and: |
65 | | - - check-success=markdown-lint |
66 | | - - or: |
67 | | - - files~=\.md$ |
68 | 89 | - files=.markdownlint-cli2.yaml |
69 | | - - files=.github/workflows/docs.yml |
70 | | - - and: |
71 | | - - -files~=\.md$ |
72 | | - - -files=.markdownlint-cli2.yaml |
73 | | - - -files=.github/workflows/docs.yml |
74 | | - |
75 | | - actions: |
76 | | - merge: |
77 | | - method: merge |
78 | | - delete_head_branch: |
79 | | - |
80 | | -- name: label-cicd |
81 | | - description: Automatically apply CI/CD label |
82 | | - conditions: |
83 | | - - or: |
84 | | - - files=.github/mergify.yml |
85 | | - - files~=^\.github/(actions|workflows)/ |
86 | | - - files=scripts/ruff.sh |
87 | | - - files=.pre-commit-config.yaml |
88 | | - - files=.pylintrc |
89 | | - - files=tox.ini |
90 | | - - files=.markdownlint-cli2.yaml |
91 | | - actions: |
92 | | - label: |
93 | | - add: |
94 | | - - CI/CD |
95 | | - |
96 | | -- name: label-documentation |
97 | | - description: Automatically apply documentation label |
98 | | - conditions: |
99 | | - - or: |
100 | | - - files~=^[^/]+\.md$ |
101 | | - actions: |
102 | | - label: |
103 | | - add: |
104 | | - - documentation |
105 | | - |
106 | | -- name: label-testing |
107 | | - description: Automatically apply testing label |
108 | | - conditions: |
109 | | - - or: |
110 | | - - files~=^tests/ |
111 | | - - files=tox.ini |
112 | | - actions: |
113 | | - label: |
114 | | - add: |
115 | | - - testing |
116 | | - |
117 | | -- name: ping author on conflicts and add 'needs-rebase' label |
118 | | - conditions: |
| 90 | + actions: |
| 91 | + label: |
| 92 | + add: |
| 93 | + - CI/CD |
| 94 | + |
| 95 | + - name: label-documentation |
| 96 | + description: Automatically apply documentation label |
| 97 | + conditions: |
| 98 | + - or: |
| 99 | + - files~=^[^/]+\.md$ |
| 100 | + actions: |
| 101 | + label: |
| 102 | + add: |
| 103 | + - documentation |
| 104 | + |
| 105 | + - name: label-testing |
| 106 | + description: Automatically apply testing label |
| 107 | + conditions: |
| 108 | + - or: |
| 109 | + - files~=^tests/ |
| 110 | + - files=tox.ini |
| 111 | + actions: |
| 112 | + label: |
| 113 | + add: |
| 114 | + - testing |
| 115 | + |
| 116 | + - name: ping author on conflicts and add 'needs-rebase' label |
| 117 | + conditions: |
119 | 118 | - conflict |
120 | 119 | - -closed |
121 | | - actions: |
122 | | - label: |
123 | | - add: |
124 | | - - needs-rebase |
125 | | - comment: |
126 | | - message: | |
127 | | - This pull request has merge conflicts that must be resolved before it can be |
128 | | - merged. @{{author}} please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
129 | | -
|
130 | | -- name: remove 'needs-rebase' label when conflict is resolved |
131 | | - conditions: |
| 120 | + actions: |
| 121 | + label: |
| 122 | + add: |
| 123 | + - needs-rebase |
| 124 | + comment: |
| 125 | + message: | |
| 126 | + This pull request has merge conflicts that must be resolved before it can be |
| 127 | + merged. @{{author}} please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
| 128 | +
|
| 129 | + - name: remove 'needs-rebase' label when conflict is resolved |
| 130 | + conditions: |
132 | 131 | - -conflict |
133 | 132 | - -closed |
134 | | - actions: |
135 | | - label: |
136 | | - remove: |
137 | | - - needs-rebase |
138 | | - |
139 | | -- name: release-branch-label |
140 | | - description: Automatically apply the release-branch label to release branch PRs |
141 | | - conditions: |
142 | | - - base~=^release- |
143 | | - actions: |
144 | | - label: |
145 | | - add: |
146 | | - - release-branch |
147 | | - |
148 | | -- name: Apply ci-failure label if any CI checks have failed |
149 | | - conditions: |
| 133 | + actions: |
| 134 | + label: |
| 135 | + remove: |
| 136 | + - needs-rebase |
| 137 | + |
| 138 | + - name: release-branch-label |
| 139 | + description: Automatically apply the release-branch label to release branch PRs |
| 140 | + conditions: |
| 141 | + - base~=^release- |
| 142 | + actions: |
| 143 | + label: |
| 144 | + add: |
| 145 | + - release-branch |
| 146 | + |
| 147 | + - name: Apply ci-failure label if any CI checks have failed |
| 148 | + conditions: |
150 | 149 | - "#check-failure>0" |
151 | | - actions: |
152 | | - label: |
153 | | - add: |
154 | | - - ci-failure |
| 150 | + actions: |
| 151 | + label: |
| 152 | + add: |
| 153 | + - ci-failure |
155 | 154 |
|
156 | | -- name: Remove ci-failure label if no failures are present |
157 | | - conditions: |
| 155 | + - name: Remove ci-failure label if no failures are present |
| 156 | + conditions: |
158 | 157 | - "#check-failure=0" |
159 | | - actions: |
160 | | - label: |
161 | | - remove: |
162 | | - - ci-failure |
| 158 | + actions: |
| 159 | + label: |
| 160 | + remove: |
| 161 | + - ci-failure |
163 | 162 |
|
164 | | -- name: Apply 'one-approval' label if one of the maintainer approved the PR |
165 | | - conditions: |
| 163 | + - name: Apply 'one-approval' label if one of the maintainer approved the PR |
| 164 | + conditions: |
166 | 165 | - "#approved-reviews-by=1" |
167 | | - actions: |
168 | | - label: |
169 | | - add: |
170 | | - - one-approval |
| 166 | + actions: |
| 167 | + label: |
| 168 | + add: |
| 169 | + - one-approval |
171 | 170 |
|
172 | | -- name: Remove 'one-approval' label if the approval was reset |
173 | | - conditions: |
| 171 | + - name: Remove 'one-approval' label if the approval was reset |
| 172 | + conditions: |
174 | 173 | - "#approved-reviews-by!=1" |
175 | | - actions: |
176 | | - label: |
177 | | - remove: |
178 | | - - one-approval |
179 | | - |
180 | | -- name: label-dependencies |
181 | | - description: Automatically apply dependencies label |
182 | | - conditions: |
183 | | - - or: |
184 | | - - files~=^requirements.*\.txt$ |
185 | | - - files~=^requirements/ |
186 | | - actions: |
187 | | - label: |
188 | | - add: |
189 | | - - dependencies |
| 174 | + actions: |
| 175 | + label: |
| 176 | + remove: |
| 177 | + - one-approval |
| 178 | + |
| 179 | + - name: label-dependencies |
| 180 | + description: Automatically apply dependencies label |
| 181 | + conditions: |
| 182 | + - or: |
| 183 | + - files~=^requirements.*\.txt$ |
| 184 | + - files~=^requirements/ |
| 185 | + actions: |
| 186 | + label: |
| 187 | + add: |
| 188 | + - dependencies |
0 commit comments