Pārlūkot izejas kodu

HUE-9447 [ci] Allow more than one digit number to github PR

Romain 5 gadi atpakaļ
vecāks
revīzija
cef644d603
2 mainītis faili ar 3 papildinājumiem un 5 dzēšanām
  1. 0 1
      tools/ci/check_for_commit_message.sh
  2. 3 4
      tools/githooks/commit-msg

+ 0 - 1
tools/ci/check_for_commit_message.sh

@@ -24,7 +24,6 @@ do
 
  if [ "$?" -ne "0" ]
   then
-    echo "Not matching commit title '$commit'"
     FOUND_ISSUE=-1
   fi
 done

+ 3 - 4
tools/githooks/commit-msg

@@ -1,13 +1,12 @@
 #!/usr/bin/env bash
 
 INPUT_FILE=$1
-START_LINE=`head -n1 $INPUT_FILE`
-PATTERN="^(HUE-[[:digit:]]+ \[.+\] .+)|(\[.+\] .+? \(#[[:digit:]]\))"
+START_LINE=${2:-`head -n1 $INPUT_FILE`}
+PATTERN="^(HUE\-[a-z0-9]+ \[.+\] .+)|(\[.+\] .+? \(#[a-z0-9]+\))"
 
 if ! [[ "$START_LINE" =~ $PATTERN ]]; then
-  echo "Bad commit message, see examples:"
+  echo "'$START_LINE' is not a valid commit message, please see for examples:"
   echo "  HUE-9374 [impala] Use 26000 as default for thrift-over-http"
   echo "  [livy] Add numExecutors options (#1238)"
   exit 1
 fi
-