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 = [
4848 ...StalenessKinds ,
4949] as const ;
5050
51- export interface Actions {
52- projectColumn ?: ColumnName | "REMOVE" ;
51+ export type Actions = {
5352 labels : LabelName [ ] ;
5453 responseComments : Comments . Comment [ ] ;
55- state ?: "close" | "merge" ;
5654 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+ ) ;
5869
5970function createDefaultActions ( ) : Actions {
6071 return {
@@ -65,14 +76,6 @@ function createDefaultActions(): Actions {
6576 } ;
6677}
6778
68- function createEmptyActions ( ) : Actions {
69- return {
70- labels : [ ] ,
71- responseComments : [ ] ,
72- shouldUpdateLabels : false ,
73- } ;
74- }
75-
7679type Staleness = {
7780 readonly kind : StalenessKind ;
7881 readonly days : number ;
@@ -223,7 +226,9 @@ export function process(prInfo: BotResult,
223226 extendedCallback : ( info : ExtendedPrInfo ) => void = _i => { } ) : Actions {
224227 if ( prInfo . type === "remove" ) {
225228 return {
226- ...createEmptyActions ( ) ,
229+ labels : [ ] ,
230+ responseComments : [ ] ,
231+ shouldUpdateLabels : false ,
227232 projectColumn : prInfo . isDraft ? "Needs Author Action" : "REMOVE" ,
228233 } ;
229234 }
You can’t perform that action at this time.
0 commit comments