0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

modules/web_hook: Make dockerhub handler output conditional; mute for now.

This commit is contained in:
Jason Volk 2023-04-04 21:14:03 -07:00
parent 219571e69c
commit fc91ace4f2

View file

@ -48,6 +48,13 @@ webhook_status_verbose
{ "default", true }, { "default", true },
}; };
conf::item<bool>
webhook_status_errors
{
{ "name", "webhook.github.status.errors" },
{ "default", true },
};
conf::item<std::string> conf::item<std::string>
webhook_github_token webhook_github_token
{ {
@ -970,7 +977,7 @@ github_handle__workflow_run(std::ostream &out,
} }
bool outputs{false}; bool outputs{false};
if(action == "requested" && conclusion == "failure") if(action == "requested" && conclusion == "failure" && webhook_status_errors)
{ {
outputs = true; outputs = true;
out out
@ -1228,7 +1235,7 @@ github_handle__workflow_job(std::ostream &out,
} }
bool outputs{false}; bool outputs{false};
if(conclusion == "failure") if(conclusion == "failure" && webhook_status_errors)
{ {
outputs = true; outputs = true;
out out
@ -2877,7 +2884,7 @@ appveyor_handle(client &client,
// dockerhub // dockerhub
// //
static void static bool
dockerhub_handle_push(std::ostream &out, dockerhub_handle_push(std::ostream &out,
std::ostream &alt, std::ostream &alt,
client &client, client &client,
@ -2909,8 +2916,9 @@ try
pubsetbuf(out, buf[0]); pubsetbuf(out, buf[0]);
pubsetbuf(alt, buf[1]); pubsetbuf(alt, buf[1]);
bool output {true};
if(request.has("push_data")) if(request.has("push_data"))
dockerhub_handle_push(out, alt, client, request); output = dockerhub_handle_push(out, alt, client, request);
const auto room_id const auto room_id
{ {
@ -2934,7 +2942,9 @@ try
const auto evid const auto evid
{ {
m::msghtml(room_id, user_id, msg, alt_msg, "m.notice") output?
m::msghtml(room_id, user_id, msg, alt_msg, "m.notice"):
m::event::id::buf{}
}; };
log::info log::info
@ -2956,7 +2966,7 @@ catch(const std::exception &e)
throw; throw;
} }
void bool
dockerhub_handle_push(std::ostream &out, dockerhub_handle_push(std::ostream &out,
std::ostream &alt, std::ostream &alt,
client &client, client &client,
@ -3009,4 +3019,6 @@ dockerhub_handle_push(std::ostream &out,
<< " to " << " to "
<< tag << tag
; ;
return bool(webhook_status_verbose);
} }