[workflow] added notification if scheduled build fails (#2574)

* [workflow] added notification if scheduled build fails

* polish code

* polish code
This commit is contained in:
Frank Lee
2023-02-06 14:03:13 +08:00
committed by GitHub
parent fba08743a8
commit 788e138960
3 changed files with 63 additions and 2 deletions

View 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)