.
This commit is contained in:
parent
ff877cc987
commit
0473ef7c37
10
bots-common/request_wiki.go
Normal file
10
bots-common/request_wiki.go
Normal file
@ -0,0 +1,10 @@
|
||||
package common
|
||||
|
||||
type WikiWebhookEvent struct {
|
||||
Action string
|
||||
Page string
|
||||
Comment string
|
||||
|
||||
Repository Repository
|
||||
Sender User
|
||||
}
|
@ -275,8 +275,24 @@ func parseRequestJSON(reqType string, data []byte) (org *common.Organization, ex
|
||||
org = pr.Repository.Owner
|
||||
extraAction = ""
|
||||
|
||||
case "wiki":
|
||||
wiki := common.WikiWebhookEvent{}
|
||||
if err = json.Unmarshal(data, &wiki); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
switch wiki.Action {
|
||||
case "created", "edited", "renamed", "deleted":
|
||||
break
|
||||
default:
|
||||
err = fmt.Errorf("Unknown Wiki webhook action type: %s", wiki.Action)
|
||||
return
|
||||
}
|
||||
org = wiki.Repository.Owner
|
||||
extraAction = wiki.Action
|
||||
|
||||
default:
|
||||
// TODO: package and wiki
|
||||
// TODO: package webhook
|
||||
err = fmt.Errorf("Unknown webhook request type: %s", reqType)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user