From 8db1cbdbc0aa1e0c8709a2a88c6afb4e022074cd Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 08:39:33 +0000 Subject: [PATCH] fix: update promo CLI examples to use vercel env run The promo encrypt/decrypt commands require environment variables like CREDIT_CATEGORIES_ENCRYPTION_KEY that are stored in Vercel. Prefix all pnpm promo invocations with 'vercel env run -e production --' so the required env vars are injected at runtime. --- src/lib/promoCreditCategories.ts | 2 +- src/scripts/encrypt-promo-codes.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/promoCreditCategories.ts b/src/lib/promoCreditCategories.ts index 2fb9a0698..beb4a57e6 100644 --- a/src/lib/promoCreditCategories.ts +++ b/src/lib/promoCreditCategories.ts @@ -327,7 +327,7 @@ const nonSelfServicePromos: readonly NonSelfServicePromoCreditCategoryConfig[] = * These are decrypted at runtime to build the actual selfServicePromos array. * * To add a new promo code: - * 1. Run: pnpm promo encrypt PROMO_CODE + * 1. Run: vercel env run -e production -- pnpm promo encrypt PROMO_CODE * 2. Copy the encrypted value and use in encrypted_credit_category */ const encryptedSelfServicePromos: readonly EncryptedSelfServicePromoCreditCategoryConfig[] = [ diff --git a/src/scripts/encrypt-promo-codes.ts b/src/scripts/encrypt-promo-codes.ts index e8ff92f06..4b94e1539 100644 --- a/src/scripts/encrypt-promo-codes.ts +++ b/src/scripts/encrypt-promo-codes.ts @@ -2,10 +2,10 @@ * Script to encrypt or decrypt promo codes. * * Run with: - * pnpm promo encrypt - * pnpm promo decrypt <encrypted> + * vercel env run -e production -- pnpm promo encrypt <plaintext> + * vercel env run -e production -- pnpm promo decrypt <encrypted> * - * Requires CREDIT_CATEGORIES_ENCRYPTION_KEY environment variable to be set. + * Requires CREDIT_CATEGORIES_ENCRYPTION_KEY environment variable (injected by vercel env run). */ import { getEnvVariable } from '@/lib/dotenvx'; @@ -21,7 +21,7 @@ if (!CREDIT_CATEGORIES_ENCRYPTION_KEY) { const [operation, value] = process.argv.slice(2); if (!operation || !value) { - console.error('Usage: pnpm promo <encrypt|decrypt> <value>'); + console.error('Usage: vercel env run -e production -- pnpm promo <encrypt|decrypt> <value>'); process.exit(1); }