Skip to content

Commit f83af97

Browse files
committed
added per-hook defined response message
1 parent 5a96a57 commit f83af97

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hook/hook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type Hook struct {
4949
ID string `json:"id"`
5050
ExecuteCommand string `json:"execute-command"`
5151
CommandWorkingDirectory string `json:"command-working-directory"`
52+
ResponseMessage string `json:"response-message"`
5253
PassArgumentsToCommand []Argument `json:"pass-arguments-to-command"`
5354
TriggerRule *Rules `json:"trigger-rule"`
5455
}

webhook.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
)
2323

2424
const (
25-
version = "2.2.1"
25+
version = "2.2.2"
2626
)
2727

2828
var (
@@ -175,9 +175,10 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
175175
// handle hook
176176
go handleHook(hook, &headers, &query, &payload, &body)
177177

178-
// say thanks
179-
fmt.Fprintf(w, "Thanks.")
178+
// send the hook defined response message
179+
fmt.Fprintf(w, hook.ResponseMessage)
180180
} else {
181+
w.WriteHeader(http.StatusNotFound)
181182
fmt.Fprintf(w, "Hook not found.")
182183
}
183184
}

0 commit comments

Comments
 (0)