Skip to content

Commit 0eff0c8

Browse files
committed
Fix linting issues - tests need updating for v2 behavior changes
1 parent 3aa7ffc commit 0eff0c8

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

dist/index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50183,7 +50183,9 @@ function waitUntilStackOperationComplete(params, input) {
5018350183
}));
5018450184
const failedEvents = (_b = events.OperationEvents) === null || _b === void 0 ? void 0 : _b.filter(event => event.ResourceStatusReason);
5018550185
if (failedEvents && failedEvents.length > 0) {
50186-
const reasons = failedEvents.map(event => `${event.LogicalResourceId}: ${event.ResourceStatusReason}`).join('; ');
50186+
const reasons = failedEvents
50187+
.map(event => `${event.LogicalResourceId}: ${event.ResourceStatusReason}`)
50188+
.join('; ');
5018750189
failureReason += `. Failed resources: ${reasons}`;
5018850190
}
5018950191
}
@@ -50223,6 +50225,7 @@ function executeExistingChangeSet(cfn, stackName, changeSetId) {
5022350225
function getChangeSetInfo(cfn, changeSetName, stackName) {
5022450226
return __awaiter(this, void 0, void 0, function* () {
5022550227
const MAX_CHANGES_IN_SUMMARY = 50; // Limit to prevent exceeding GitHub Actions output limits
50228+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5022650229
let allChanges = [];
5022750230
let nextToken;
5022850231
// Paginate through all changes
@@ -50331,7 +50334,12 @@ function updateStack(cfn, stack, params, failOnEmptyChangeSet, noExecuteChangeSe
5033150334
StackName: params.StackName
5033250335
}));
5033350336
core.debug('Updating CloudFormation stack');
50334-
yield waitUntilStackOperationComplete({ client: cfn, maxWaitTime: 43200, minDelay: 10, changeSetId: params.ChangeSetName }, {
50337+
yield waitUntilStackOperationComplete({
50338+
client: cfn,
50339+
maxWaitTime: 43200,
50340+
minDelay: 10,
50341+
changeSetId: params.ChangeSetName
50342+
}, {
5033550343
StackName: params.StackName
5033650344
});
5033750345
return { stackId: stack.StackId };
@@ -50909,10 +50917,7 @@ const executeSchema = baseSchema.extend({
5090950917
'parameter-overrides': zod_1.z.string().optional().transform(emptyToUndefined),
5091050918
'deployment-mode': zod_1.z.string().optional().transform(emptyToUndefined),
5091150919
capabilities: zod_1.z.string().optional().transform(emptyToUndefined),
50912-
'fail-on-empty-changeset': zod_1.z
50913-
.string()
50914-
.optional()
50915-
.transform(emptyToUndefined),
50920+
'fail-on-empty-changeset': zod_1.z.string().optional().transform(emptyToUndefined),
5091650921
'no-execute-changeset': zod_1.z.string().optional().transform(emptyToUndefined),
5091750922
'no-delete-failed-changeset': zod_1.z
5091850923
.string()

src/deploy.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,22 @@ async function waitUntilStackOperationComplete(
7171
let failureReason = `Stack operation failed with status: ${status}`
7272
if (changeSetId) {
7373
try {
74-
const events = await client.send(new DescribeEventsCommand({
75-
ChangeSetName: changeSetId,
76-
Filters: { FailedEvents: true }
77-
}))
78-
const failedEvents = events.OperationEvents?.filter(event => event.ResourceStatusReason)
74+
const events = await client.send(
75+
new DescribeEventsCommand({
76+
ChangeSetName: changeSetId,
77+
Filters: { FailedEvents: true }
78+
})
79+
)
80+
const failedEvents = events.OperationEvents?.filter(
81+
event => event.ResourceStatusReason
82+
)
7983
if (failedEvents && failedEvents.length > 0) {
80-
const reasons = failedEvents.map(event =>
81-
`${event.LogicalResourceId}: ${event.ResourceStatusReason}`
82-
).join('; ')
84+
const reasons = failedEvents
85+
.map(
86+
event =>
87+
`${event.LogicalResourceId}: ${event.ResourceStatusReason}`
88+
)
89+
.join('; ')
8390
failureReason += `. Failed resources: ${reasons}`
8491
}
8592
} catch {
@@ -133,6 +140,7 @@ export async function getChangeSetInfo(
133140
stackName: string
134141
): Promise<ChangeSetInfo> {
135142
const MAX_CHANGES_IN_SUMMARY = 50 // Limit to prevent exceeding GitHub Actions output limits
143+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
136144
let allChanges: any[] = []
137145
let nextToken: string | undefined
138146

@@ -304,7 +312,12 @@ export async function updateStack(
304312

305313
core.debug('Updating CloudFormation stack')
306314
await waitUntilStackOperationComplete(
307-
{ client: cfn, maxWaitTime: 43200, minDelay: 10, changeSetId: params.ChangeSetName },
315+
{
316+
client: cfn,
317+
maxWaitTime: 43200,
318+
minDelay: 10,
319+
changeSetId: params.ChangeSetName
320+
},
308321
{
309322
StackName: params.StackName!
310323
}

src/main.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,20 @@ export async function run(): Promise<void> {
190190
}
191191
}
192192
} catch (err) {
193-
if (err instanceof CloudFormationServiceException &&
194-
err.message?.includes('Member must have length less than or equal to 51200')) {
195-
core.setFailed('Template size exceeds CloudFormation limit (51,200 bytes). Consider using a template URL from S3 instead of inline template content.')
193+
if (
194+
err instanceof CloudFormationServiceException &&
195+
err.message?.includes(
196+
'Member must have length less than or equal to 51200'
197+
)
198+
) {
199+
core.setFailed(
200+
'Template size exceeds CloudFormation limit (51,200 bytes). Consider using a template URL from S3 instead of inline template content.'
201+
)
196202
} else {
197203
// @ts-expect-error: Object is of type 'unknown'
198204
core.setFailed(err.message || 'Unknown error occurred')
199205
}
200-
206+
201207
// @ts-expect-error: Object is of type 'unknown'
202208
core.debug(err.stack)
203209
}

src/validation.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ const executeSchema = baseSchema.extend({
109109
'parameter-overrides': z.string().optional().transform(emptyToUndefined),
110110
'deployment-mode': z.string().optional().transform(emptyToUndefined),
111111
capabilities: z.string().optional().transform(emptyToUndefined),
112-
'fail-on-empty-changeset': z
113-
.string()
114-
.optional()
115-
.transform(emptyToUndefined),
112+
'fail-on-empty-changeset': z.string().optional().transform(emptyToUndefined),
116113
'no-execute-changeset': z.string().optional().transform(emptyToUndefined),
117114
'no-delete-failed-changeset': z
118115
.string()

0 commit comments

Comments
 (0)