Skip to content

Commit

Permalink
dci-merge.sh: handle no-check correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlepied committed Jan 10, 2024
1 parent f44b0a3 commit 6fba174
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hack/dci-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6fba174

Please sign in to comment.