cloudcomponents/cdk-constructs

bug(cdk-codepipeline-slack): New ENV handling is breaking the Slack notifier

netroy opened this issue · 0 comments

I see that you folks switched to get-env-or-die for reading env variables.
Since this change, the env fallbacks defined in the code breaks the lambda function completely ('' is false-y in JS).

Previously only one of SLACK_CHANNEL and SLACK_CHANNEL_ID was needed. So, this change breaks the notifier for anyone who was passing in only one of these two env variables.

I've temporarily fixed this by manually patching the lambda code

const bot = new SlackBot({
  token: getEnv('SLACK_BOT_TOKEN'),
  channelName: process.env.SLACK_CHANNEL,
  channelId: null,
  channelTypes: getEnv('SLACK_CHANNEL_TYPES'),
  name: getEnv('SLACK_BOT_NAME', 'Pipeline Bot'),
  icon: getEnv('SLACK_BOT_ICON', ':robot_face:'),
});