comparison mod_pubsub_github/mod_pubsub_github.lua @ 3531:3bece2db869c

mod_pubsub_github: Assume unspecified event is 'push' if there are commits in payload
author Kim Alvefur <zash@zash.se>
date Sun, 31 Mar 2019 19:10:23 +0200
parents 552d4944d1ca
children
comparison
equal deleted inserted replaced
3530:552d4944d1ca 3531:3bece2db869c
57 if node_mapping then 57 if node_mapping then
58 node = node_prefix .. data.repository[node_mapping]; 58 node = node_prefix .. data.repository[node_mapping];
59 end 59 end
60 60
61 local github_event = request.headers.x_github_event or data.object_kind; 61 local github_event = request.headers.x_github_event or data.object_kind;
62 if not github_event and data.commits then
63 github_event = "push"; -- curl?
64 end
62 module:log("debug", "Handling '%s' event: \n%s\n", github_event, tostring(request.body)); 65 module:log("debug", "Handling '%s' event: \n%s\n", github_event, tostring(request.body));
63 66
64 if github_event == "push" then 67 if github_event == "push" then
65 68
66 for _, commit in ipairs(data.commits) do 69 for _, commit in ipairs(data.commits) do