Mercurial > prosody-modules
comparison mod_pubsub_github/mod_pubsub_github.lua @ 3529:6ac98c4dbbd3
mod_pubsub_github: Get event type from payload (should work with gitlab)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 31 Mar 2019 19:07:22 +0200 |
| parents | bcfd6e5bb0f5 |
| children | 552d4944d1ca |
comparison
equal
deleted
inserted
replaced
| 3528:1fcf3cb7bb50 | 3529:6ac98c4dbbd3 |
|---|---|
| 56 local node = default_node; | 56 local node = default_node; |
| 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 | 61 local github_event = request.headers.x_github_event or data.object_kind; |
| 62 if github_event == "push" then | 62 if github_event == "push" then |
| 63 module:log("debug", "Handling 'push' event: \n%s\n", tostring(request.body)); | 63 module:log("debug", "Handling 'push' event: \n%s\n", tostring(request.body)); |
| 64 elseif github_event then | 64 elseif github_event then |
| 65 module:log("debug", "Unsupported Github event %q", github_event); | 65 module:log("debug", "Unsupported Github event %q", github_event); |
| 66 return 501; | 66 return 501; |
