mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-07 20:10:17 +00:00
[workflow] added notification if scheduled build fails (#2574)
* [workflow] added notification if scheduled build fails * polish code * polish code
This commit is contained in:
20
.github/workflows/scripts/send_message_to_lark.py
vendored
Normal file
20
.github/workflows/scripts/send_message_to_lark.py
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import argparse
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-m', '--message', type=str)
|
||||
parser.add_argument('-u', '--url', type=str)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def send_message_to_lark(message, webhook_url):
|
||||
data = {"msg_type": "text", "content": {"text": message}}
|
||||
requests.post(webhook_url, json=data)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = parse_args()
|
||||
send_message_to_lark(args.message, args.url)
|
Reference in New Issue
Block a user