@@ -52,8 +52,7 @@ export interface Actions {
52
52
targetColumn ?: ColumnName ;
53
53
labels : LabelName [ ] ;
54
54
responseComments : Comments . Comment [ ] ;
55
- shouldClose : boolean ;
56
- shouldMerge : boolean ;
55
+ state ?: "close" | "merge" ;
57
56
shouldUpdateLabels : boolean ;
58
57
shouldUpdateProjectColumn : boolean ;
59
58
shouldRemoveFromActiveColumns : boolean ;
@@ -64,8 +63,6 @@ function createDefaultActions(): Actions {
64
63
targetColumn : "Other" ,
65
64
labels : [ ] ,
66
65
responseComments : [ ] ,
67
- shouldClose : false ,
68
- shouldMerge : false ,
69
66
shouldUpdateLabels : true ,
70
67
shouldUpdateProjectColumn : true ,
71
68
shouldRemoveFromActiveColumns : false ,
@@ -76,8 +73,6 @@ function createEmptyActions(): Actions {
76
73
return {
77
74
labels : [ ] ,
78
75
responseComments : [ ] ,
79
- shouldClose : false ,
80
- shouldMerge : false ,
81
76
shouldUpdateLabels : false ,
82
77
shouldUpdateProjectColumn : false ,
83
78
shouldRemoveFromActiveColumns : false ,
@@ -334,7 +329,7 @@ export function process(prInfo: BotResult,
334
329
( info . tooManyOwners || info . hasMultiplePackages ) ? [ ] : info . otherOwners ,
335
330
headCommitAbbrOid ) ) ;
336
331
if ( info . hasValidMergeRequest ) {
337
- context . shouldMerge = true ;
332
+ context . state = "merge" ;
338
333
context . targetColumn = "Recently Merged" ;
339
334
} else {
340
335
context . targetColumn = "Waiting for Author to Merge" ;
@@ -348,7 +343,7 @@ export function process(prInfo: BotResult,
348
343
}
349
344
}
350
345
351
- if ( ! context . shouldMerge ) {
346
+ if ( ! context . state ) {
352
347
if ( info . mergeRequestUser ) {
353
348
post ( Comments . WaitUntilMergeIsOK ( info . mergeRequestUser , headCommitAbbrOid , urls . workflow ) ) ;
354
349
}
@@ -385,7 +380,7 @@ function makeStaleness(now: Date, author: string, otherOwners: string[]) { // cu
385
380
}
386
381
if ( state === "done" ) {
387
382
if ( doneColumn === "CLOSE" ) {
388
- context . shouldClose = true ;
383
+ context . state = "close" ;
389
384
context . shouldRemoveFromActiveColumns = true ;
390
385
} else {
391
386
context . targetColumn = doneColumn ;
0 commit comments