-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
374 lines (324 loc) · 11.3 KB
/
triage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
name: Triage tasks
on: pull_request_target
env:
GH_REPO: ${{ github.repository }}
GH_NO_UPDATE_NOTIFIER: 1
GH_PROMPT_DISABLED: 1
defaults:
run:
shell: bash -xeuo pipefail {0}
concurrency:
group: "triage-${{ github.event.number }}"
cancel-in-progress: true
permissions: {}
jobs:
upload-metadata:
permissions:
contents: read
if: always() && github.repository_owner == 'Homebrew'
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v4
with:
name: event_payload
path: ${{ github.event_path }}
workflows-label:
permissions:
contents: read
issues: write
pull-requests: write
if: always() && github.repository_owner == 'Homebrew'
runs-on: ubuntu-latest
steps:
- name: Check pull request changed files
id: files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
run: |
workflow_modified="$(
gh api \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"repos/$GITHUB_REPOSITORY/pulls/$PR/files" \
--jq 'any(.[].filename; startswith(".github/workflows"))'
)"
# Fail closed.
echo "workflow_modified=${workflow_modified:-true}" >> "${GITHUB_OUTPUT}"
# Wait briefly in case of failure to make sure we don't end up
# hitting the same API error when trying `gh pr edit`.
- if: failure()
run: sleep 30
- name: Label PR
if: always() && fromJson(steps.files.outputs.workflow_modified)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
run: gh pr edit --add-label workflows "$PR" --repo "$GITHUB_REPOSITORY"
limit-pull-requests:
if: >
always() && github.repository_owner == 'Homebrew' &&
(github.event_name == 'pull_request_target' &&
github.event.action == 'opened')
permissions:
contents: read
issues: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: Homebrew/actions/limit-pull-requests@master
with:
except-users: |
BrewTestBot
comment-limit: 15
comment: |
Hi, thanks for your contribution to Homebrew! :heart:
You already have >=15 open pull requests, so please get them ready to be merged or close them before you open more. If CI fails on any of them, please fix it or ask for help doing so.
If you are performing simple version bumps, @BrewTestBot automatically bumps [a list of formulae](https://github.com/${{ github.repository }}/blob/HEAD/.github/autobump.txt) so you don't need to. Please take a look at issues and pull requests labelled https://github.com/${{ github.repository }}/labels/help%20wanted and see if you can help to fix any of them. Thanks!
close-limit: 30
close: true
triage:
runs-on: ubuntu-22.04
permissions:
contents: read
issues: write
pull-requests: write
statuses: write
steps:
- name: Check commit format
if: >
github.actor != 'BrewTestBot' &&
!contains(github.event.pull_request.labels.*.name, 'CI-published-bottle-commits')
uses: Homebrew/actions/check-commit-format@master
with:
token: ${{secrets.GITHUB_TOKEN}}
- name: Label pull request
uses: Homebrew/actions/label-pull-requests@master
if: always()
with:
token: ${{secrets.GITHUB_TOKEN}}
def: |
- label: new formula
status: added
path: Formula/.+
allow_any_match: true
- label: marked for removal/rejection
status: removed
path: Formula/.+
- label: no ARM bottle
path: Formula/.+
content: '\n sha256.* (?!.*(?:arm64_|_linux)).+: +"[a-fA-F0-9]+"\n'
missing_content: '\n sha256.* (arm64_.+|all): +"[a-fA-F0-9]+"\n'
- label: no Linux bottle
path: Formula/.+
content: \n bottle do\n
missing_content:
- '\n sha256.* x86_64_linux: +"[a-fA-F0-9]+"\n'
- '\n sha256.* all: +"[a-fA-F0-9]+"\n'
- depends_on :macos
- label: formula deprecated
path: Formula/.+
content: \n deprecate!.*\n
- label: formula disabled
path: Formula/.+
content: \n disable!.*\n
- label: legacy
path: Formula/.+@.+
except:
- Formula/b/[email protected]
- Formula/i/[email protected]
- Formula/lib/[email protected]
- Formula/o/[email protected]
- Formula/p/[email protected]
- Formula/p/[email protected]
- Formula/p/[email protected]
- Formula/p/[email protected]
- label: missing license
path: Formula/.+
missing_content: \n license .+\n
- label: deprecated license
path: Formula/.+
content: license .*"(GPL|LGPL|AGPL|GFDL)-[0-9].[0-9][+]?".*
- label: boost
path: Formula/.+
content: depends_on "boost(@[0-9.]+)?"
- label: ffmpeg
path: Formula/.+
content: depends_on "ffmpeg(@[0-9.]+)?"
- label: go
path: Formula/.+
content: depends_on "go(@[0-9.]+)?"
- label: haskell
path: Formula/.+
content: depends_on "(ghc|haskell-stack)(@[0-9.]+)?"
- label: icu4c
path: Formula/.+
content: depends_on "icu4c(@[0-9.]+)?"
- label: java
path: Formula/.+
content: depends_on "openjdk(@[0-9.]+)?"
- label: linux-only
path: Formula/.+
content: depends_on :linux
- label: macos-only
path: Formula/.+
content: depends_on :macos
- label: lua
path: Formula/.+
content: depends_on "(lua|luajit|luajit-openresty)(@[0-9.]+)?"
- label: nodejs
path: Formula/.+
content: depends_on "node(@[0-9.]+)?"
- label: ocaml
path: Formula/.+
content: depends_on "ocaml(@[0-9.]+)?"
- label: perl
path: Formula/.+
content: (depends_on|uses_from_macos) "perl(@[0-9.]+)?"
- label: php
path: Formula/.+
content: (depends_on|uses_from_macos) "php(@[0-9.]+)?"
- label: python
path: Formula/.+
content: (depends_on|uses_from_macos) "python(@[0-9.]+)?"
missing_content: (depends_on|uses_from_macos) "python(@[0-9.]+)?" => \[?:(build|test)
- label: ruby
path: Formula/.+
content: (depends_on|uses_from_macos) "ruby(@[0-9.]+)?"
- label: rust
path: Formula/.+
content: depends_on "rust(@[0-9.]+)?"
- label: zig
path: Formula/.+
content: depends_on "zig(@[0-9.]+)?"
- label: dotnet
path: Formula/.+
content: depends_on "dotnet(@[0-9.]+)?"
- label: swift
path: Formula/.+
content: system "swift", "build"
- label: long build
path: "Formula/.+/(\
agda|\
apache-pulsar|\
arangodb|\
aws-sdk-cpp|\
cbmc|\
cp2k|\
deno|\
dotnet|\
emscripten|\
envoy|\
gcc|\
ghc|\
graph-tool|\
gstreamer|\
haskell-language-server|\
libtensorflow|\
mame|\
metashell|\
mlkit|\
mpich|\
node|\
octave|\
opencascade|\
pcl|\
ponyc|\
pytorch|\
qt|\
root|\
rtabmap|\
rust|\
souffle|\
swift|\
texlive|\
v8|\
vtk\
)(@[0-9.]+)?.rb"
keep_if_no_match: true
allow_any_match: true
- label: long dependent tests
path: "Formula/.+/(\
at-spi2-core|\
boost|\
brotli|\
c-ares|\
dav1d|\
freetype|\
gcc|\
ghc|\
glib|\
gsettings-desktop-schemas|\
gtk\\+3|\
harfbuzz|\
highway|\
hwloc|\
icu4c|\
imath|\
jasper|\
jpeg-turbo|\
libcap|\
libgcrypt|\
libgpg-error|\
libidn2|\
libmicrohttpd|\
librist|\
libnghttp2|\
libomp|\
libpng|\
libunistring|\
mpfr|\
mpg123|\
node|\
numpy|\
openblas|\
openjpeg|\
p11-kit|\
pango|\
pcre2|\
rav1e|\
rust|\
shared-mime-info|\
suite-sparse|\
qt|\
readline|\
unbound|\
xz|\
zstd\
).rb"
keep_if_no_match: true
allow_any_match: true
- label: CI-build-dependents-from-source
path:
- 'Formula/.+/(cabal-install|docbook-xsl|emscripten|erlang|ocaml|ocaml-findlib|ocaml-num|openjdk|rust)\.rb'
- 'Aliases/(ghc|go)(@[0-9.]+)?$'
missing_content: '\n revision [0-9]+\n'
keep_if_no_match: true
allow_any_match: true
- label: CI-skip-recursive-dependents
path: Formula/.+/(ca-certificates|curl|gettext|openssl@3|sqlite).rb
keep_if_no_match: true
- label: CI-linux-self-hosted
path: Formula/.+/(dart-sdk|dotnet|envoy|qt(@5)?|texlive).rb
keep_if_no_match: true
allow_any_match: true
- label: CI-linux-self-hosted-deps
path: "Formula/.+/(\
alsa-lib|\
glib|\
libva|\
libxml2|\
systemd|\
wayland-protocols|\
zlib|\
).rb"
keep_if_no_match: true
allow_any_match: true
- label: bump-formula-pr
pr_body_content: Created with `brew bump-formula-pr`
- label: pip-audit
pr_body_content: Created by `brew-pip-audit`
- label: autobump
path: \.github/autobump\.txt
allow_any_match: true