mirror of
https://github.com/matrix-construct/construct
synced 2025-03-17 06:50:23 +01:00
modules/web_hook: Query proper attributes to determine delete op on push.
This commit is contained in:
parent
3e2e876ebe
commit
d20e53f33a
1 changed files with 19 additions and 1 deletions
|
@ -522,6 +522,21 @@ bool
|
|||
github_handle__push(std::ostream &out,
|
||||
const json::object &content)
|
||||
{
|
||||
const bool created
|
||||
{
|
||||
content.get("created", false)
|
||||
};
|
||||
|
||||
const bool deleted
|
||||
{
|
||||
content.get("deleted", false)
|
||||
};
|
||||
|
||||
const bool forced
|
||||
{
|
||||
content.get("forced", false)
|
||||
};
|
||||
|
||||
const json::array commits
|
||||
{
|
||||
content["commits"]
|
||||
|
@ -532,7 +547,7 @@ github_handle__push(std::ostream &out,
|
|||
size(commits)
|
||||
};
|
||||
|
||||
if(!count)
|
||||
if(!count && deleted)
|
||||
{
|
||||
out << " <font color=\"#FF0000\">";
|
||||
if(content["ref"])
|
||||
|
@ -542,6 +557,9 @@ github_handle__push(std::ostream &out,
|
|||
return true;
|
||||
}
|
||||
|
||||
if(!count && !webhook_status_verbose)
|
||||
return false;
|
||||
|
||||
if(content["ref"])
|
||||
{
|
||||
const json::string ref(content["ref"]);
|
||||
|
|
Loading…
Add table
Reference in a new issue