Diff

mod_pubsub_github/mod_pubsub_github.lua @ 3514:8811b7dbe6e2

mod_pubsub_github: Add support for specifying an actor with less privileges
author Kim Alvefur <zash@zash.se>
date Sun, 31 Mar 2019 17:59:17 +0200
parent 3513:9556e92b2ec4
child 3515:f756e051fa02
line wrap: on
line diff
--- a/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 17:47:45 2019 +0200
+++ b/mod_pubsub_github/mod_pubsub_github.lua	Sun Mar 31 17:59:17 2019 +0200
@@ -6,6 +6,7 @@
 
 local pubsub_service = module:depends("pubsub").service;
 local node = module:get_option("github_node", "github");
+local github_actor = module:get_option_string("github_actor") or true;
 local secret = module:get_option("github_secret");
 
 local error_mapping = {
@@ -35,7 +36,7 @@
 	end -- else .. is this even github?
 
 	for _, commit in ipairs(data.commits) do
-		local ok, err = pubsub_service:publish(node, true, data.repository.name,
+		local ok, err = pubsub_service:publish(node, github_actor, data.repository.name,
 			st.stanza("item", { id = data.repository.name, xmlns = "http://jabber.org/protocol/pubsub" })
 			:tag("entry", { xmlns = "http://www.w3.org/2005/Atom" })
 				:tag("id"):text(commit.id):up()