diff --git a/python/dbt_test_alert.py b/python/dbt_test_alert.py index 0c00ca4..627c438 100644 --- a/python/dbt_test_alert.py +++ b/python/dbt_test_alert.py @@ -122,6 +122,9 @@ def send_alert(webhook_url): if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") - send_alert(webhook_url) \ No newline at end of file + data = log_test_result() + + # Only send an alert if there are failures + if data['fail_count'] > 0: + send_alert(webhook_url) \ No newline at end of file