added per-hook defined response message
This commit is contained in:
parent
5a96a5721a
commit
f83af97138
@ -49,6 +49,7 @@ type Hook struct {
|
|||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
ExecuteCommand string `json:"execute-command"`
|
ExecuteCommand string `json:"execute-command"`
|
||||||
CommandWorkingDirectory string `json:"command-working-directory"`
|
CommandWorkingDirectory string `json:"command-working-directory"`
|
||||||
|
ResponseMessage string `json:"response-message"`
|
||||||
PassArgumentsToCommand []Argument `json:"pass-arguments-to-command"`
|
PassArgumentsToCommand []Argument `json:"pass-arguments-to-command"`
|
||||||
TriggerRule *Rules `json:"trigger-rule"`
|
TriggerRule *Rules `json:"trigger-rule"`
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "2.2.1"
|
version = "2.2.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -175,9 +175,10 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
// handle hook
|
// handle hook
|
||||||
go handleHook(hook, &headers, &query, &payload, &body)
|
go handleHook(hook, &headers, &query, &payload, &body)
|
||||||
|
|
||||||
// say thanks
|
// send the hook defined response message
|
||||||
fmt.Fprintf(w, "Thanks.")
|
fmt.Fprintf(w, hook.ResponseMessage)
|
||||||
} else {
|
} else {
|
||||||
|
w.WriteHeader(http.StatusNotFound)
|
||||||
fmt.Fprintf(w, "Hook not found.")
|
fmt.Fprintf(w, "Hook not found.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user