-
-
Notifications
You must be signed in to change notification settings - Fork 594
123 lines (114 loc) 路 3.99 KB
/
Copy pathlabels.yml
File metadata and controls
123 lines (114 loc) 路 3.99 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
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
name: Label PRs
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: github.repository_owner == 'thedaviddias'
steps:
- name: Ensure managed labels exist
uses: actions/github-script@v8
with:
script: |
const labelDefinitions = [
{
name: 'area:content',
color: '0E8A16',
description: 'Touches content website entries or generated website data.'
},
{
name: 'lane:mdx-fast',
color: '1D76DB',
description: 'Eligible for the MDX auto-merge fast lane.'
},
{
name: 'lane:standard',
color: '5319E7',
description: 'Requires standard human review.'
},
{
name: 'lane:blocked',
color: 'B60205',
description: 'Blocked from fast-lane processing.'
},
{
name: 'status:blocked',
color: 'D93F0B',
description: 'Needs manual intervention before review.'
},
{
name: 'risk:low',
color: '0E8A16',
description: 'Low-risk change based on deterministic intake rules.'
},
{
name: 'risk:high',
color: 'B60205',
description: 'High-risk or mixed change based on deterministic intake rules.'
},
{
name: 'generated:websites-json',
color: 'FBCA04',
description: 'Touches generated data/websites.json.'
},
{
name: 'needs:generated-file-review',
color: 'D876E3',
description: 'Manual review required because data/websites.json was changed outside automation.'
},
{
name: 'needs:manual-review',
color: 'D876E3',
description: 'Manual review required before merging.'
},
{
name: 'automerge:candidate',
color: '0E8A16',
description: 'Eligible for auto-merge after required checks pass.'
},
{
name: 'deploy:preview',
color: '5319E7',
description: 'Opt in to building a Vercel Preview deployment for this PR.'
}
]
const existingLabels = await github.paginate(github.rest.issues.listLabelsForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100
})
const existingByName = new Map(
existingLabels.map(label => [label.name, label])
)
for (const definition of labelDefinitions) {
const existing = existingByName.get(definition.name)
if (!existing) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
...definition
})
continue
}
if (
existing.color.toLowerCase() !== definition.color.toLowerCase() ||
(existing.description ?? '') !== definition.description
) {
await github.rest.issues.updateLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: definition.name,
new_name: definition.name,
color: definition.color,
description: definition.description
})
}
}
- uses: actions/labeler@v6
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true