11name : " Automatic Labeling"
22
33on :
4- pull_request :
4+ pull_request_target :
55 types : [opened, synchronize, reopened]
66 issues :
77 types : [opened, reopened]
1313 permissions :
1414 issues : write
1515 pull-requests : write
16-
16+
1717 steps :
1818 - name : Checkout repository
1919 uses : actions/checkout@v5
3232 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3333 xs_label : ' size/xs'
3434 xs_max_size : ' 10'
35- s_label : ' size/s'
35+ s_label : ' size/s'
3636 s_max_size : ' 100'
3737 m_label : ' size/m'
3838 m_max_size : ' 500'
@@ -51,62 +51,62 @@ jobs:
5151 const title = context.payload.issue.title.toLowerCase();
5252 const body = context.payload.issue.body?.toLowerCase() || '';
5353 const text = title + ' ' + body;
54-
54+
5555 const labels = [];
56-
56+
5757 // GPU/Hardware related
58- if (text.includes('gpu') || text.includes('cuda') || text.includes('device') ||
58+ if (text.includes('gpu') || text.includes('cuda') || text.includes('device') ||
5959 text.includes('memory') || text.includes('jax.device')) {
6060 labels.push('gpu-support');
6161 }
62-
62+
6363 // Performance related
6464 if (text.includes('slow') || text.includes('performance') || text.includes('speed') ||
6565 text.includes('memory usage') || text.includes('regression') || text.includes('benchmark')) {
6666 labels.push('performance');
6767 }
68-
68+
6969 // Numerical stability
7070 if (text.includes('numerical') || text.includes('instability') || text.includes('nan') ||
7171 text.includes('inf') || text.includes('convergence') || text.includes('precision')) {
7272 labels.push('numerical-stability');
7373 }
74-
74+
7575 // JAX compatibility
76- if (text.includes('jax') || text.includes('jit') || text.includes('vmap') ||
76+ if (text.includes('jax') || text.includes('jit') || text.includes('vmap') ||
7777 text.includes('pmap') || text.includes('xla')) {
7878 labels.push('jax-compatibility');
7979 }
80-
80+
8181 // Component detection
8282 if (text.includes('kernel') || text.includes('rbf') || text.includes('matern')) {
8383 labels.push('kernels');
8484 }
85-
85+
8686 if (text.includes('gaussian process') || text.includes(' gp ') || text.includes('posterior') ||
8787 text.includes('prior') || text.includes('inference')) {
8888 labels.push('gps');
8989 }
90-
90+
9191 if (text.includes('variational') || text.includes('elbo') || text.includes('svgp')) {
9292 labels.push('variational');
9393 }
94-
94+
9595 if (text.includes('likelihood') || text.includes('bernoulli') || text.includes('poisson')) {
9696 labels.push('likelihoods');
9797 }
98-
98+
9999 if (text.includes('optimization') || text.includes('optimizer') || text.includes('fit') ||
100100 text.includes('scipy') || text.includes('optax')) {
101101 labels.push('optimization');
102102 }
103-
103+
104104 // Documentation related
105105 if (text.includes('documentation') || text.includes('docs') || text.includes('example') ||
106106 text.includes('tutorial') || text.includes('docstring')) {
107107 labels.push('documentation');
108108 }
109-
109+
110110 // Bug vs Feature detection
111111 if (text.includes('bug') || text.includes('error') || text.includes('fail') ||
112112 text.includes('broken') || text.includes('issue') || text.includes('problem')) {
@@ -115,7 +115,7 @@ jobs:
115115 text.includes('implement') || text.includes('support') || text.includes('new')) {
116116 labels.push('enhancement');
117117 }
118-
118+
119119 // Difficulty assessment
120120 if (text.includes('good first issue') || text.includes('beginner') || text.includes('easy')) {
121121 labels.push('good first issue');
@@ -124,14 +124,14 @@ jobs:
124124 } else if (text.includes('complex') || text.includes('advanced') || text.includes('expert')) {
125125 labels.push('expert-level');
126126 }
127-
127+
128128 // Priority detection
129129 if (text.includes('urgent') || text.includes('critical') || text.includes('blocking')) {
130130 labels.push('priority/high');
131131 } else if (text.includes('nice to have') || text.includes('low priority')) {
132132 labels.push('priority/low');
133133 }
134-
134+
135135 // Apply labels
136136 if (labels.length > 0) {
137137 await github.rest.issues.addLabels({
@@ -150,51 +150,51 @@ jobs:
150150 const title = context.payload.pull_request.title.toLowerCase();
151151 const body = context.payload.pull_request.body?.toLowerCase() || '';
152152 const text = title + ' ' + body;
153-
153+
154154 const labels = [];
155-
155+
156156 // Breaking changes
157157 if (text.includes('breaking') || text.includes('breaking change') ||
158158 title.includes('!:') || body.includes('breaking change')) {
159159 labels.push('breaking-change');
160160 }
161-
161+
162162 // Dependencies
163163 if (title.includes('deps') || title.includes('dependenc') || title.includes('bump') ||
164164 text.includes('requirements') || text.includes('pyproject.toml')) {
165165 labels.push('dependencies');
166166 }
167-
168- // CI/Infrastructure
167+
168+ // CI/Infrastructure
169169 if (text.includes('github actions') || text.includes('workflow') || text.includes('.yml') ||
170170 text.includes('ci') || text.includes('pipeline')) {
171171 labels.push('ci');
172172 }
173-
173+
174174 // Performance improvements
175175 if (text.includes('performance') || text.includes('optimization') || text.includes('faster') ||
176176 text.includes('efficient') || text.includes('benchmark')) {
177177 labels.push('performance');
178178 }
179-
179+
180180 // Documentation
181181 if (text.includes('docs') || text.includes('readme') || text.includes('docstring') ||
182182 text.includes('example') || text.includes('.md') || text.includes('tutorial')) {
183183 labels.push('documentation');
184184 }
185-
185+
186186 // Tests
187187 if (text.includes('test') || text.includes('pytest') || text.includes('coverage') ||
188188 title.startsWith('test:') || text.includes('testing')) {
189189 labels.push('tests');
190190 }
191-
191+
192192 // Security
193193 if (text.includes('security') || text.includes('vulnerability') || text.includes('cve') ||
194194 text.includes('safety') || text.includes('bandit')) {
195195 labels.push('security');
196196 }
197-
197+
198198 // Apply labels
199199 if (labels.length > 0) {
200200 await github.rest.issues.addLabels({
0 commit comments