@@ -3,10 +3,10 @@ import debug from 'debug';
33import _ from 'lodash' ;
44import sendBuildkiteAnnotation from './annotate' ;
55import { updateDecisions } from './decide' ;
6- import Config from './models/config' ;
7- import { isGroupStep , mergeGroups } from './models/group-step' ;
6+ import Config , { keysInConfigs } from './models/config' ;
7+ import { mergeGroups } from './models/group-step' ;
88import { Pipeline } from './models/pipeline' ;
9- import { Step } from './models/step' ;
9+ import { isGroupStep , Step } from './models/step' ;
1010import { ARTIFACT_INJECTION_STEP_KEY , artifactInjectionSteps } from './steps/artifact-injection' ;
1111import { nothingToDoSteps } from './steps/nothing-to-do' ;
1212import { recordSuccessSteps } from './steps/record-success' ;
@@ -23,9 +23,7 @@ const log = debug('monofo:merge');
2323 * This method also mutates the steps of the passed-in configs directly
2424 */
2525export function replaceExcludedKeys ( configs : Config [ ] , hasArtifactStep : boolean ) : void {
26- const excludedKeys : string [ ] = configs
27- . filter ( ( c ) => ! c . included )
28- . flatMap ( ( c ) => c . steps . map ( ( s ) => ( typeof s . key === 'string' ? s . key : '' ) ) . filter ( ( v ) => v ) ) ;
26+ const excludedKeys : string [ ] = keysInConfigs ( configs . filter ( ( c : Config ) => ! c . included ) ) ;
2927
3028 // If there's no artifact dependencies for the whole build, no need to wait for this step (it won't be added either)
3129 const replaceWith = hasArtifactStep ? ARTIFACT_INJECTION_STEP_KEY : '' ;
0 commit comments