Skip to content

Commit

Permalink
fix: update snapshot-check slack error message to follow conventions (#…
Browse files Browse the repository at this point in the history
…263)

Signed-off-by: samuelarogbonlo <[email protected]>
  • Loading branch information
samuelarogbonlo authored Sep 19, 2023
1 parent f3b5b41 commit 6d8bcb6
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def slack_alert(message, thread_ts=None):
client = WebClient(token=os.environ['SLACK_TOKEN'])
CHANNEL_NAME = '#forest-notifications'

# Format message as a JSON-like string for better readability.
message = f'```{json.dumps(message, indent=4, ensure_ascii=False)}```'

# Try sending message, catch and print any errors.
try:
response = client.chat_postMessage(channel=CHANNEL_NAME, text=message, thread_ts=thread_ts)
Expand Down Expand Up @@ -141,7 +138,7 @@ def main():
if not checks_passed:
thread = slack_alert("⛔ Snapshot check failed. 🔥🌲🔥")
for error_message in error_messages:
slack_alert({"error": error_message}, thread_ts=thread)
slack_alert(error_message, thread_ts=thread)
return {
"result": "⛔ failure",
"message": "Some checks did not pass. Please review the issues reported. Let's fix them and keep the forest green!. 🔥🌲🔥"
Expand Down

0 comments on commit 6d8bcb6

Please sign in to comment.