mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 15:07:35 +01:00
Add tag push support to webhooks
This commit is contained in:
parent
1d223cc16f
commit
f2799349ab
@ -123,12 +123,15 @@ def webhook():
|
||||
|
||||
event = request.headers.get("X-GitHub-Event")
|
||||
if event == "push":
|
||||
title = json["head_commit"]["message"].partition("\n")[0]
|
||||
ref = json["after"]
|
||||
title = json["head_commit"]["message"].partition("\n")[0]
|
||||
elif event == "create" and json["ref_type"] == "tag":
|
||||
ref = json["ref"]
|
||||
title = ref
|
||||
elif event == "ping":
|
||||
return jsonify({ "success": True, "message": "Ping successful" })
|
||||
else:
|
||||
return error(400, "Unsupported event. Only 'push' and 'ping' are supported.")
|
||||
return error(400, "Unsupported event. Only 'push', `create:tag`, and 'ping' are supported.")
|
||||
|
||||
#
|
||||
# Perform release
|
||||
|
@ -54,8 +54,11 @@ def webhook():
|
||||
if event == "push":
|
||||
ref = json["after"]
|
||||
title = ref[:5]
|
||||
elif event == "tag_push":
|
||||
ref = json["ref"]
|
||||
title = ref.replace("refs/tags/", "")
|
||||
else:
|
||||
return error(400, "Unsupported event. Only 'push' is supported.")
|
||||
return error(400, "Unsupported event. Only 'push' and 'tag_push' are supported.")
|
||||
|
||||
#
|
||||
# Perform release
|
||||
|
Loading…
Reference in New Issue
Block a user