-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
73 lines (63 loc) · 2.51 KB
/
label.yml
File metadata and controls
73 lines (63 loc) · 2.51 KB
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
name: Label issues
on:
issues:
types:
- opened
- reopened
jobs:
label_issues:
name: "Issue: add labels"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Label new issues
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Combine title + body
const title = context.payload.issue.title || ''
const body = context.payload.issue.body || ''
const content = `${title}\n${body}`
// Always start with triage
const labels = ['triage']
// Map each directory/tracker → regex
const mapping = {
'reid' : /\b(?:appearance|re[- ]?id|re[- ]?identification)\b/i,
'kf' : /\b(?:kf|kalman[- ]?filter)s?\b/i,
'postprocessing' : /\bpostprocessing\b/i,
// engine-related categories
'engine' : /\b(engine|cli|detectors|track|val)\b/i,
'tuning' : /\b(?:tuning|hyperparameter(?:s)?|evolution|evolve)\b/i,
'evaluation' : /\b(?:evaluation|eval(?:uation)?|val(?:idation)?)\b/i,
'tracking' : /\b(?:track(?:ing)?|track)\b/i,
// individual tracker labels
'boosttrack' : /\bboosttrack\b/i,
'botsort' : /\bbotsort\b/i,
'bytetrack' : /\bbytetrack\b/i,
'deepocsort' : /\bdeepocsort\b/i,
'hybridsort' : /\bhybridsort\b/i,
'ocsort' : /\bocsort\b/i,
'strongsort' : /\bstrongsort\b/i,
'tracktrack' : /\btracktrack\b/i,
// per-dataset labels
'datasets' : /\dataset?\b/i,
'mot17' : /\bMOT17\b/i,
'mot20' : /\bMOT20\b/i,
'dancetrack' : /\bDanceTrack\b/i,
}
// Add any matching labels
for (const [label, regex] of Object.entries(mapping)) {
if (regex.test(content)) {
labels.push(label)
}
}
// Apply them in one call
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels
})