diff --git a/common.sh b/common.sh index 392b4e2..b77eb56 100755 --- a/common.sh +++ b/common.sh @@ -319,6 +319,15 @@ notify() { log "$ICON_NOTIFY Sending notification: $subject — $message" + # A dry run must not page anyone. It reaches this line by walking the same branches a real run + # would, so a --dry-run failover was one populated webhook away from alerting the operator at + # 4am about an outage nothing was acting on. The line above still records what WOULD have been + # sent, which is the part a preview is for. + if [[ "${DRY_RUN:-false}" == true ]]; then + log "$ICON_NOTIFY DRY RUN — notification not sent" + return 0 + fi + if [[ "${NOTIFY_UNRAID:-false}" == true ]]; then if platform_send_os_notification "$message" "$subject" "$severity"; then log "$ICON_NOTIFY OS notification sent"