From 1dcabf6a78415b49e893c971210e078f62762172 Mon Sep 17 00:00:00 2001 From: FURRO404 Date: Thu, 18 Jun 2026 01:36:52 -0700 Subject: [PATCH] fix(web): webhook reloads via ecosystem file so committed env (VEHICLE_*) applies on deploy --- webhook.cjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/webhook.cjs b/webhook.cjs index 500f1df..b383f72 100644 --- a/webhook.cjs +++ b/webhook.cjs @@ -560,9 +560,17 @@ async function deploy(push) { promoteBuiltDist() syncVehicleIcons() - for (const target of RESTART_TARGETS) { - await run('pm2', ['reload', target, '--update-env']) - } + // Reload via the ecosystem file (not by bare name) with --only so each deploy + // re-reads the committed env blocks (e.g. VEHICLE_* paths). `pm2 reload + // --update-env` would only merge the CLI's process.env and ignore the file. + // --only excludes tssbot-webhook so the webhook never reloads itself mid-deploy. + await run('pm2', [ + 'reload', + 'ecosystem.config.cjs', + '--only', + RESTART_TARGETS.join(','), + '--update-env', + ]) await notifyDeployCompleted(push, diff) } catch (error) {