This repository was archived by the owner on Jul 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,24 @@ export const LabelNames = [
48
48
...StalenessKinds
49
49
] as const ;
50
50
51
- export interface Actions {
52
- projectColumn ?: ColumnName | "REMOVE" ;
51
+ export type Actions = {
53
52
labels : LabelName [ ] ;
54
53
responseComments : Comments . Comment [ ] ;
55
- state ?: "close" | "merge" ;
56
54
shouldUpdateLabels : boolean ;
57
- }
55
+ } & (
56
+ | {
57
+ state ?: never ;
58
+ projectColumn ?: ColumnName | "REMOVE" ;
59
+ }
60
+ | {
61
+ state : "close" ;
62
+ projectColumn : "REMOVE" ;
63
+ }
64
+ | {
65
+ state : "merge" ;
66
+ projectColumn : "Recently Merged" ;
67
+ }
68
+ ) ;
58
69
59
70
function createDefaultActions ( ) : Actions {
60
71
return {
@@ -65,14 +76,6 @@ function createDefaultActions(): Actions {
65
76
} ;
66
77
}
67
78
68
- function createEmptyActions ( ) : Actions {
69
- return {
70
- labels : [ ] ,
71
- responseComments : [ ] ,
72
- shouldUpdateLabels : false ,
73
- } ;
74
- }
75
-
76
79
type Staleness = {
77
80
readonly kind : StalenessKind ;
78
81
readonly days : number ;
@@ -223,7 +226,9 @@ export function process(prInfo: BotResult,
223
226
extendedCallback : ( info : ExtendedPrInfo ) => void = _i => { } ) : Actions {
224
227
if ( prInfo . type === "remove" ) {
225
228
return {
226
- ...createEmptyActions ( ) ,
229
+ labels : [ ] ,
230
+ responseComments : [ ] ,
231
+ shouldUpdateLabels : false ,
227
232
projectColumn : prInfo . isDraft ? "Needs Author Action" : "REMOVE" ,
228
233
} ;
229
234
}
You can’t perform that action at this time.
0 commit comments