Skip to content

Commit 2d67849

Browse files
author
Cliff Odijk
committed
Allow running multiple directories
1 parent f9d1598 commit 2d67849

6 files changed

Lines changed: 20 additions & 15 deletions

File tree

.projenrc.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ const project = new GitHubActionTypeScriptProject({
8282
required: false,
8383
default: '',
8484
},
85-
cdkOutDir: {
86-
description: 'The location of the CDK output directory',
85+
cdkOutDirs: {
86+
description: 'The location of the CDK output directories',
8787
required: false,
88-
default: 'cdk.out',
88+
default: '',
8989
},
9090
diffMethod: {
9191
description: [

action.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Comments } from './comment';
1414
import { Inputs } from './inputs';
1515
import { AssemblyProcessor } from './stage-processor';
1616

17-
export async function run() {
17+
export async function run(cdkOutDir: string) {
1818
const inputs: Inputs = {
1919
title: getInput('title') || undefined,
2020
defaultStageDisplayName: getInput('defaultStageDisplayName', {
@@ -28,7 +28,7 @@ export async function run() {
2828
required: true,
2929
}),
3030
noFailOnDestructiveChanges: getMultilineInput('noFailOnDestructiveChanges'),
31-
cdkOutDir: getInput('cdkOutDir', { required: true }),
31+
cdkOutDir: cdkOutDir,
3232
diffMethod: getInput('diffMethod', { required: true }),
3333
};
3434

src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import * as core from '@actions/core';
22
import { run } from './action';
33

4-
run().catch((error: any) => {
5-
core.setFailed(error.message);
6-
});
4+
const dirs: string = core.getInput('cdkOutDirs', { required: true });
5+
6+
Promise.all(dirs.split(',').map((dir) => run(`${dir}/cdk.out`))).catch(
7+
(error: any) => {
8+
core.setFailed(error.message);
9+
},
10+
);

0 commit comments

Comments
 (0)