mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/webhook: Support organization-level webhooks in header display.
This commit is contained in:
parent
99f3c842d1
commit
ee9e82f53c
1 changed files with 20 additions and 3 deletions
|
@ -221,9 +221,26 @@ github_heading(std::ostream &out,
|
|||
content["repository"]
|
||||
};
|
||||
|
||||
out << "<a href=\"" << unquote(repository["html_url"]) << "\">"
|
||||
<< unquote(repository["full_name"])
|
||||
<< "</a>";
|
||||
const json::object organization
|
||||
{
|
||||
content["organization"]
|
||||
};
|
||||
|
||||
if(empty(repository))
|
||||
{
|
||||
const auto url
|
||||
{
|
||||
lstrip(unquote(organization["url"]), "https://api.")
|
||||
};
|
||||
|
||||
out << "<a href=\"https://" << url << "\">"
|
||||
<< unquote(organization["login"])
|
||||
<< "</a>";
|
||||
}
|
||||
else
|
||||
out << "<a href=" << repository["html_url"] << ">"
|
||||
<< unquote(repository["full_name"])
|
||||
<< "</a>";
|
||||
|
||||
const string_view commit_hash
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue