From 6fba174ba38a78efe9965122354a372bcde5b30f Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 10 Jan 2024 13:59:03 +0100 Subject: [PATCH] dci-merge.sh: handle no-check correctly --- hack/dci-merge.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hack/dci-merge.sh b/hack/dci-merge.sh index 459eb37ca..ef20cc289 100755 --- a/hack/dci-merge.sh +++ b/hack/dci-merge.sh @@ -63,8 +63,11 @@ fi VIRT= PRS=$(git log --merges ${BASE_SHA}..${HEAD_SHA} | grep -oP 'Merge pull request #\K\d+') +NB_PRS=0 +NB_NOCHECK=0 for PR in $PRS; do if [ -n "$PR" ]; then + NB_PRS=$((NB_PRS+1)) DESC=$(curl -s "${GH_HEADERS[@]/#/-H}" https://api.github.com/repos/redhatci/ansible-collection-redhatci-ocp/pulls/"$PR"|jq -r .body) if [[ sno =~ $SUPPORTED_HINTS ]] && grep -qi "^\s*Test-Hints:\s*sno\s*" <<< "$DESC"; then @@ -100,6 +103,7 @@ for PR in $PRS; do fi if [[ no-check =~ $SUPPORTED_HINTS ]] && grep -qi "^\s*Test-Hints:\s*no-check\s*" <<< "$DESC"; then + NB_NOCHECK=$((NB_NOCHECK+1)) continue fi @@ -156,6 +160,10 @@ done # if nothing is specified if [ -z "$VIRT" ]; then + if [ "$NB_NOCHECK" -eq "$NB_PRS" ]; then + send_status success "No check" + exit 0 + fi VIRT=--sno fi