M gitsrht-update-hook/types.go => gitsrht-update-hook/types.go +0 -13
@@ 54,19 54,6 @@ type Commit struct {
Signature *CommitSignature `json:"signature"`
}
-type UpdatedRef struct {
- Tag *AnnotatedTag `json:"annotated_tag",omitempty`
- Name string `json:"name"`
- Old *Commit `json:"old"`
- New *Commit `json:"commit"`
-}
-
-type WebhookPayload struct {
- Push string `json:"push"`
- Pusher UserContext `json:"pusher"`
- Refs []UpdatedRef `json:"refs"`
-}
-
func GitCommitToWebhookCommit(c *object.Commit) *Commit {
parents := make([]string, len(c.ParentHashes))
for i, p := range c.ParentHashes {
M gitsrht-update-hook/webhooks.go => gitsrht-update-hook/webhooks.go +13 -0
@@ 42,6 42,19 @@ type WebhookDelivery struct {
Url string
}
+type UpdatedRef struct {
+ Tag *AnnotatedTag `json:"annotated_tag",omitempty`
+ Name string `json:"name"`
+ Old *Commit `json:"old"`
+ New *Commit `json:"new"`
+}
+
+type WebhookPayload struct {
+ Push string `json:"push"`
+ Pusher UserContext `json:"pusher"`
+ Refs []UpdatedRef `json:"refs"`
+}
+
func initWebhookKey() {
b64key, ok := config.Get("webhooks", "private-key")
if !ok {