mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 22:41:12 +01:00
modules/webhook: Toggle non-failure status events via conf item.
This commit is contained in:
parent
ebdbc0864c
commit
b353f3d0ac
1 changed files with 15 additions and 1 deletions
|
@ -41,6 +41,13 @@ webhook_url
|
|||
{ "default", "/webhook" }
|
||||
};
|
||||
|
||||
conf::item<bool>
|
||||
webhook_status_verbose
|
||||
{
|
||||
{ "name", "webhook.github.status.verbose" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
resource
|
||||
webhook_resource
|
||||
{
|
||||
|
@ -174,9 +181,17 @@ github_handle(client &client,
|
|||
};
|
||||
|
||||
if(type == "status")
|
||||
{
|
||||
if(unquote(request["state"]) == "pending")
|
||||
return;
|
||||
|
||||
if(!webhook_status_verbose) switch(hash(unquote(request["state"])))
|
||||
{
|
||||
case "failure"_: break;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
|
||||
const unique_buffer<mutable_buffer> buf
|
||||
{
|
||||
48_KiB
|
||||
|
@ -945,7 +960,6 @@ github_handle__status(std::ostream &out,
|
|||
content["target_url"]
|
||||
};
|
||||
|
||||
|
||||
if(state == "success")
|
||||
out << " "
|
||||
<< "<font data-mx-bg-color=\"#03B381\">"
|
||||
|
|
Loading…
Reference in a new issue