pull/289/head
Frostebite 2021-08-15 16:38:40 +00:00 committed by GitHub
parent 1aa8a9a9b1
commit 8542ed8985
3 changed files with 6 additions and 4 deletions

2
dist/index.js vendored
View File

@ -1050,7 +1050,7 @@ class AWSBuildEnvironment {
Parameters: parameters, Parameters: parameters,
Capabilities: ['CAPABILITY_IAM'], Capabilities: ['CAPABILITY_IAM'],
}; };
const stacks = (_a = (yield CF.listStacks().promise()).StackSummaries) === null || _a === void 0 ? void 0 : _a.map((x) => x.StackName); const stacks = (_a = (yield CF.listStacks({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE'] }).promise()).StackSummaries) === null || _a === void 0 ? void 0 : _a.map((x) => x.StackName);
const stackExists = (stacks === null || stacks === void 0 ? void 0 : stacks.includes(baseStackName)) || false; const stackExists = (stacks === null || stacks === void 0 ? void 0 : stacks.includes(baseStackName)) || false;
const describeStack = () => __awaiter(this, void 0, void 0, function* () { const describeStack = () => __awaiter(this, void 0, void 0, function* () {
return yield CF.describeStacks(describeStackInput).promise(); return yield CF.describeStacks(describeStackInput).promise();

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -258,14 +258,16 @@ class AWSBuildEnvironment implements RemoteBuilderProviderInterface {
Capabilities: ['CAPABILITY_IAM'], Capabilities: ['CAPABILITY_IAM'],
}; };
const stacks = (await CF.listStacks().promise()).StackSummaries?.map((x) => x.StackName); const stacks = (
await CF.listStacks({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE'] }).promise()
).StackSummaries?.map((x) => x.StackName);
const stackExists: Boolean = stacks?.includes(baseStackName) || false; const stackExists: Boolean = stacks?.includes(baseStackName) || false;
const describeStack = async () => { const describeStack = async () => {
return await CF.describeStacks(describeStackInput).promise(); return await CF.describeStacks(describeStackInput).promise();
}; };
if (!stackExists) { if (!stackExists) {
core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks, undefined, 4)})`); core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks)})`);
await CF.createStack(createStackInput).promise(); await CF.createStack(createStackInput).promise();
core.info(`created stack (version: ${hash})`); core.info(`created stack (version: ${hash})`);
} }