Skip to content

Commit c5b69ce

Browse files
committed
Remove tunnel
1 parent d8d20d9 commit c5b69ce

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

integrations/linear/src/webhooks.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,6 @@ export function createWebhookEventSource(
211211
// easily identify webhooks on linear
212212
const label = `trigger.${params.teamId ? params.teamId : "all"}`;
213213

214-
// TODO: remove tunnel
215-
const url = process.env["DEV_TUNNEL"]
216-
? httpSource.url.replace("http://localhost:3030", process.env["DEV_TUNNEL"])
217-
: httpSource.url;
218-
219214
if (httpSource.active && webhookData.success) {
220215
const hasMissingOptions = Object.values(options).some(
221216
(option) => option.missing.length > 0
@@ -228,7 +223,7 @@ export function createWebhookEventSource(
228223
label,
229224
resourceTypes: allEvents,
230225
secret: httpSource.secret,
231-
url,
226+
url: httpSource.url,
232227
},
233228
});
234229

@@ -240,7 +235,7 @@ export function createWebhookEventSource(
240235

241236
// check for existing hooks that match url
242237
const listResponse = await io.integration.webhooks().list("list-webhooks");
243-
const existingWebhook = listResponse.find((w) => w.url === url);
238+
const existingWebhook = listResponse.find((w) => w.url === httpSource.url);
244239

245240
if (existingWebhook) {
246241
const updatedWebhook = await io.integration.webhooks().update("update-webhook", {
@@ -249,7 +244,7 @@ export function createWebhookEventSource(
249244
label,
250245
resourceTypes: allEvents,
251246
secret: httpSource.secret,
252-
url,
247+
url: httpSource.url,
253248
},
254249
});
255250

@@ -265,7 +260,7 @@ export function createWebhookEventSource(
265260
resourceTypes: allEvents,
266261
secret: httpSource.secret,
267262
teamId: params.teamId,
268-
url,
263+
url: httpSource.url,
269264
});
270265

271266
// TODO
@@ -299,8 +294,7 @@ async function webhookHandler(event: HandlerEvent<"HTTP">, logger: Logger, integ
299294
LINEAR_IPS[0]
300295
).split(",")[0];
301296

302-
// TODO: remove tunnel
303-
if (!process.env["DEV_TUNNEL"] && !LINEAR_IPS.includes(clientIp)) {
297+
if (!LINEAR_IPS.includes(clientIp)) {
304298
logger.error("[@trigger.dev/linear] Error validating webhook source, IP invalid.");
305299
throw Error("[@trigger.dev/linear] Invalid source IP.");
306300
}

0 commit comments

Comments
 (0)