mirror of
https://github.com/harness/drone.git
synced 2025-05-13 23:50:47 +08:00
Allow any case/seq to be used for “[CI SKIP]”
Eg. [ci skip] [skipci] [skip ci] [CI SKIP]
This commit is contained in:
parent
bf87b3146e
commit
f21d503d2c
@ -3,6 +3,7 @@ package handler
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/drone/drone/plugin/remote"
|
"github.com/drone/drone/plugin/remote"
|
||||||
@ -43,7 +44,8 @@ func PostHook(c web.C, w http.ResponseWriter, r *http.Request) {
|
|||||||
// in some cases we have neither a hook nor error. An example
|
// in some cases we have neither a hook nor error. An example
|
||||||
// would be GitHub sending a ping request to the URL, in which
|
// would be GitHub sending a ping request to the URL, in which
|
||||||
// case we'll just exit quiely with an 'OK'
|
// case we'll just exit quiely with an 'OK'
|
||||||
if hook == nil || strings.Contains(hook.Message, "[CI SKIP]") {
|
shouldSkip, _ := regexp.MatchString(`\[(?i:ci *skip|skip *ci)\]`, hook.Message)
|
||||||
|
if hook == nil || shouldSkip {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user