From f21d503d2c1483dcde4b9f4aa7a030fbdc40bd58 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Wed, 12 Aug 2015 11:52:21 +0200 Subject: [PATCH] =?UTF-8?q?Allow=20any=20case/seq=20to=20be=20used=20for?= =?UTF-8?q?=20=E2=80=9C[CI=20SKIP]=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eg. [ci skip] [skipci] [skip ci] [CI SKIP] --- server/handler/hook.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/handler/hook.go b/server/handler/hook.go index 8ac4d4c1..a79fb465 100644 --- a/server/handler/hook.go +++ b/server/handler/hook.go @@ -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 }