From afad90673a3cf1bd72a8bb950ec615ba1f1c6621 Mon Sep 17 00:00:00 2001 From: deepfotello Date: Thu, 2 Apr 2026 12:37:09 +0530 Subject: [PATCH] fix(eventarc): set eventTrigger.region from channel to prevent unnecessary delete+recreate on deploy --- src/v2/providers/eventarc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/v2/providers/eventarc.ts b/src/v2/providers/eventarc.ts index f00597bab..e02225218 100644 --- a/src/v2/providers/eventarc.ts +++ b/src/v2/providers/eventarc.ts @@ -201,6 +201,8 @@ export function onCustomEventPublished( func.run = handler; const channel = opts.channel ?? "locations/us-central1/channels/firebase"; + const channelRegionMatch = channel.match(/locations\/([^/]+)\/channels\//); + const triggerRegion = channelRegionMatch ? channelRegionMatch[1] : "us-central1"; const baseOpts = options.optionsToEndpoint(options.getGlobalOptions()); const specificOpts = options.optionsToEndpoint(opts); @@ -219,6 +221,7 @@ export function onCustomEventPublished( eventFilters: {}, retry: opts.retry ?? false, channel, + region: triggerRegion, }, }; convertIfPresent(endpoint.eventTrigger, opts, "eventFilters", "filters");