Skip to content

Commit

Permalink
Format report build failure script
Browse files Browse the repository at this point in the history
  • Loading branch information
Stormheg committed Nov 7, 2024
1 parent b7fdeb7 commit 9227842
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .circleci/report_nightly_build_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
This reports an error to the #nightly-build-failures Slack channel.
"""

import os

import requests

if 'SLACK_WEBHOOK_URL' in os.environ:
if "SLACK_WEBHOOK_URL" in os.environ:
print("Reporting to #nightly-build-failures slack channel")
response = requests.post(os.environ['SLACK_WEBHOOK_URL'], json={
"text": "A Nightly build failed. See " + os.environ['CIRCLE_BUILD_URL'],
})
response = requests.post(
os.environ["SLACK_WEBHOOK_URL"],
json={
"text": "A Nightly build failed. See " + os.environ["CIRCLE_BUILD_URL"],
},
)

print("Slack responded with:", response)

else:
print("Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set")
print(
"Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set"
)

0 comments on commit 9227842

Please sign in to comment.