@@ -188,11 +188,19 @@ const closeIssues = async (octokit, context, componentsToIssueNumber, removedCom
188
188
state : "closed"
189
189
} ) ;
190
190
191
- octokit . rest . issues . addLabels ( {
192
- ...repository ,
193
- issue_number : issueNumber ,
194
- labels : [ 'drift-recovered' ]
195
- } ) ;
191
+ if ( componentsToIssueNumber [ slug ] . error ) {
192
+ octokit . rest . issues . addLabels ( {
193
+ ...repository ,
194
+ issue_number : issueNumber ,
195
+ labels : [ 'error-recovered' ]
196
+ } ) ;
197
+ } else {
198
+ octokit . rest . issues . addLabels ( {
199
+ ...repository ,
200
+ issue_number : issueNumber ,
201
+ labels : [ 'drift-recovered' ]
202
+ } ) ;
203
+ }
196
204
197
205
let comment = `Component \`${ slug } \` is not drifting anymore` ;
198
206
if ( removedComponents . hasOwnProperty ( slug ) ) {
@@ -251,12 +259,14 @@ const createIssues = async (octokit, context, maxOpenedIssues, labels, users, co
251
259
const slug = componentsCandidatesToCreateIssue [ i ] ;
252
260
const issueTitle = erroredComponents . includes ( slug ) ? `Failure Detected in \`${ slug } \`` : `Drift Detected in \`${ slug } \`` ;
253
261
const issueDescription = fs . readFileSync ( `issue-description-${ slug } .md` , 'utf8' ) ;
254
-
262
+
263
+ const label = erroredComponents . includes ( slug ) ? "error" : "drift"
264
+
255
265
const newIssue = await octokit . rest . issues . create ( {
256
266
...repository ,
257
267
title : issueTitle ,
258
268
body : issueDescription ,
259
- labels : [ "drift" ] . concat ( labels )
269
+ labels : [ label ] . concat ( labels )
260
270
} ) ;
261
271
262
272
const issueNumber = newIssue . data . number ;
0 commit comments