Skip to content

Commit 8ef42b5

Browse files
committed
format code
1 parent d1ad024 commit 8ef42b5

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

lambdas/functions/webhook/src/webhook/index.test.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ describe('handle GitHub webhook events', () => {
7676
const other = JSON.stringify({ ...workFlowJobEvent, action: 'mutated' });
7777

7878
await expect(
79-
publishForRunners({ 'X-Hub-Signature-256': await webhooks.sign(other), 'X-GitHub-Event': 'workflow_job' }, event, config),
79+
publishForRunners(
80+
{ 'X-Hub-Signature-256': await webhooks.sign(other), 'X-GitHub-Event': 'workflow_job' },
81+
event,
82+
config,
83+
),
8084
).rejects.toMatchObject({
8185
statusCode: 401,
8286
});
@@ -86,7 +90,11 @@ describe('handle GitHub webhook events', () => {
8690
const event = JSON.stringify(workFlowJobEvent);
8791

8892
await expect(
89-
publishForRunners({ 'X-Hub-Signature-256': await webhooks.sign(event), 'X-GitHub-Event': 'invalid' }, event, config),
93+
publishForRunners(
94+
{ 'X-Hub-Signature-256': await webhooks.sign(event), 'X-GitHub-Event': 'invalid' },
95+
event,
96+
config,
97+
),
9098
).rejects.toMatchObject({
9199
statusCode: 202,
92100
});
@@ -100,7 +108,11 @@ describe('handle GitHub webhook events', () => {
100108
});
101109

102110
await expect(
103-
publishForRunners({ 'X-Hub-Signature-256': await webhooks.sign(event), 'X-GitHub-Event': 'workflow_job' }, event, config),
111+
publishForRunners(
112+
{ 'X-Hub-Signature-256': await webhooks.sign(event), 'X-GitHub-Event': 'workflow_job' },
113+
event,
114+
config,
115+
),
104116
).resolves.toMatchObject({
105117
statusCode: 201,
106118
});

lambdas/functions/webhook/src/webhook/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import { publish } from '../eventbridge';
1010
import { ConfigWebhook, ConfigWebhookEventBridge } from '../ConfigLoader';
1111
const logger = createChildLogger('handler');
1212

13-
export async function publishForRunners(headers: IncomingHttpHeaders, body: string, config: ConfigWebhook): Promise<Response> {
13+
export async function publishForRunners(
14+
headers: IncomingHttpHeaders,
15+
body: string,
16+
config: ConfigWebhook,
17+
): Promise<Response> {
1418
init(headers);
1519

1620
await verifySignature(headers, body, config.webhookSecret);

0 commit comments

Comments
 (0)