Skip to content

Commit

Permalink
feat: allow specifying a custom cdk.out directory (#43)
Browse files Browse the repository at this point in the history
Fixes #40
  • Loading branch information
corymhall committed Jan 17, 2024
1 parent c90937f commit 8458e7a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ const project = new GitHubActionTypeScriptProject({
required: false,
default: 'List of stages where breaking changes will not fail the build',
},
cdkOutDir: {
description: 'The location of the CDK output directory',
required: false,
default: 'cdk.out',
},
},
runs: {
using: RunsUsing.NODE_16, // overwrite to node20
Expand Down
4 changes: 4 additions & 0 deletions action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export async function run() {
githubToken: getInput('githubToken'),
noDiffForStages: getInput('noDiffForStages').split(','),
noFailOnDestructiveChanges: getInput('noFailOnDestructiveChanges').split(','),
cdkOutDir: getInput('cdkOutDir') ?? 'cdk.out',
};
const octokit = github.getOctokit(inputs.githubToken);
const context = github.context;
try {
const assembly = AssemblyManifestReader.fromPath('cdk.out');
const assembly = AssemblyManifestReader.fromPath(inputs.cdkOutDir);
let stages = assembly.stages;
if (!stages.length) {
stages = [{
Expand Down
7 changes: 7 additions & 0 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ export interface Inputs {
* @default - breaking changes on any stage will fail the build
*/
noFailOnDestructiveChanges: string[];

/**
* The location of the CDK output directory
*
* @default cdk.out
*/
cdkOutDir: string;
}

0 comments on commit 8458e7a

Please sign in to comment.