diff --git a/scripts/notify.py b/scripts/notify.py index 12442b8231..d0966ee498 100755 --- a/scripts/notify.py +++ b/scripts/notify.py @@ -5,18 +5,22 @@ import requests import json +import os # This URL is tied to a single channel. That can be generalized, or you can # create a new "app" to use another channel. -WEBHOOK = ( - "https://hooks.slack.com/services/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" -) - +WEBHOOK = os.environ.get("WEBHOOK_URL") +if WEBHOOK is None: + print("Webhook URL not found in WEBHOOK_URL env var. Will just print messages.") def notify(message): headers = {"Content-Type": "application/json"} data = json.dumps({"text": message}) - requests.post(WEBHOOK, data=data, headers=headers) + if WEBHOOK is None: + print(message) + else: + requests.post(WEBHOOK, data=data, headers=headers) + if __name__ == "__main__":