mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-07-25 08:19:15 +00:00
fix(deploy): pass BotOwnerID and AdminUserIDs from samconfig.toml in CI
CI's --parameter-overrides replaces (not merges with) samconfig.toml's parameter_overrides, so BOT_OWNER_ID was empty in the deployed Lambda. deploynotify silently skipped sending the post-deploy DM, and all Protected/Private commands were denied. Extract the values from samconfig.toml at deploy time so the file remains the single source of truth for non-secret deploy params. Also add 'stats' to samconfig.toml's ModulesCSV so local `sam deploy` doesn't regress the stats module.
This commit is contained in:
@@ -54,7 +54,12 @@ jobs:
|
||||
--name "/miti99bot/${STACK_ENV}/cron-shared-secret" \
|
||||
--with-decryption --query Parameter.Value --output text)
|
||||
echo "::add-mask::$CRON_SECRET"
|
||||
OVERRIDES="CronSharedSecret=$CRON_SECRET"
|
||||
# Extract non-secret deploy params from samconfig.toml so it stays
|
||||
# the single source of truth (CI's --parameter-overrides replaces,
|
||||
# not merges with, samconfig.toml values).
|
||||
BOT_OWNER_ID=$(sed -n 's/.*BotOwnerID=\\"\\([^\\]*\\)\\".*/\1/p' samconfig.toml)
|
||||
ADMIN_USER_IDS=$(sed -n 's/.*AdminUserIDs=\\"\\([^\\]*\\)\\".*/\1/p' samconfig.toml)
|
||||
OVERRIDES="CronSharedSecret=$CRON_SECRET BotOwnerID=$BOT_OWNER_ID AdminUserIDs=$ADMIN_USER_IDS"
|
||||
if [ -n "$ALERT_EMAIL" ]; then
|
||||
OVERRIDES="$OVERRIDES AlertEmail=$ALERT_EMAIL"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user