add: repository update destroy webhook

This commit is contained in:
2021-07-27 16:44:58 +08:00
parent cb1a4d8c8c
commit 8b53aac8a6
7 changed files with 511 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
json.id @webhook.id
json.(@webhook, :id, :http_method, :content_type, :url, :secret, :last_status, :is_active)
json.type @webhook.hook_task_type
json.create_time Time.at(@webhook.created_unix).strftime("%Y-%m-%d %H:%M:%S")
event = JSON.parse(@webhook.events)
json.branch_filter event["branch_filter"]
if event["send_everything"]
json.events event["events"].keys
else
json.events event["events"].select{|k, v| v}.keys
end