Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit e0741c7

Browse files
authored
Fix githubEndpoint trigger resource (#893)
1 parent 6cff3a4 commit e0741c7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cdk-infra/lib/constructs/api/webhook-api-construct.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ export class WebhookApiConstruct extends Construct {
133133
const localEndpoint = webhookEndpoint.addResource('local');
134134
const snootyEndpoint = webhookEndpoint.addResource('snooty');
135135

136+
// Shared /githubEndpoint/trigger endpoint
137+
const githubEndpointTrigger = githubEndpoint.addResource('trigger');
138+
136139
const defaultCorsPreflightOptions: CorsOptions = {
137140
allowOrigins: Cors.ALL_ORIGINS,
138141
};
@@ -153,13 +156,11 @@ export class WebhookApiConstruct extends Construct {
153156
.addResource('upsert', { defaultCorsPreflightOptions })
154157
.addMethod('POST', new LambdaIntegration(dochubTriggerUpsertLambda));
155158

156-
githubEndpoint
157-
.addResource('trigger')
159+
githubEndpointTrigger
158160
.addResource('build', { defaultCorsPreflightOptions })
159161
.addMethod('POST', new LambdaIntegration(githubTriggerLambda));
160162

161-
githubEndpoint
162-
.addResource('trigger')
163+
githubEndpointTrigger
163164
.addResource('delete', { defaultCorsPreflightOptions })
164165
.addMethod('POST', new LambdaIntegration(githubDeleteArtifactsLambda));
165166

0 commit comments

Comments
 (0)