mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 20:31:10 +00:00
Merge pull request #1134 from net2b/skip-ci
Allow any case/seq to be used for “[CI SKIP]”
This commit is contained in:
commit
57b009e3c4
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@ package handler
|
|||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"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
|
||||
// would be GitHub sending a ping request to the URL, in which
|
||||
// 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)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue