mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
modules/web_hook: Support github create event.
This commit is contained in:
parent
75f35ad696
commit
fb15e8c30b
1 changed files with 29 additions and 0 deletions
|
@ -153,6 +153,10 @@ static bool
|
|||
github_handle__delete(std::ostream &,
|
||||
const json::object &content);
|
||||
|
||||
static bool
|
||||
github_handle__create(std::ostream &,
|
||||
const json::object &content);
|
||||
|
||||
static bool
|
||||
github_handle__ping(std::ostream &,
|
||||
const json::object &content);
|
||||
|
@ -232,6 +236,8 @@ github_handle(client &client,
|
|||
github_handle__status(out, request.content):
|
||||
type == "repository"?
|
||||
github_handle__repository(out, request.content):
|
||||
type == "create"?
|
||||
github_handle__create(out, request.content):
|
||||
type == "delete"?
|
||||
github_handle__delete(out, request.content):
|
||||
|
||||
|
@ -1122,6 +1128,29 @@ github_handle__repository(std::ostream &out,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
github_handle__create(std::ostream &out,
|
||||
const json::object &content)
|
||||
{
|
||||
const json::string &ref
|
||||
{
|
||||
content["ref"]
|
||||
};
|
||||
|
||||
const json::string &ref_type
|
||||
{
|
||||
content["ref_type"]
|
||||
};
|
||||
|
||||
out << ' '
|
||||
<< ref_type
|
||||
<< ' '
|
||||
<< ref
|
||||
;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
github_handle__delete(std::ostream &out,
|
||||
const json::object &content)
|
||||
|
|
Loading…
Reference in a new issue