From e34d6977a0538b5e9c74611c8cdb785ddee8cdf3 Mon Sep 17 00:00:00 2001 From: paoloredis Date: Thu, 22 Aug 2024 12:38:41 +0200 Subject: [PATCH] Allow non-zero exit codes for certain commands --- .github/workflows/redis_docs_sync.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/redis_docs_sync.yaml b/.github/workflows/redis_docs_sync.yaml index 0a83866747..d108836809 100644 --- a/.github/workflows/redis_docs_sync.yaml +++ b/.github/workflows/redis_docs_sync.yaml @@ -47,13 +47,16 @@ jobs: # check if remote branch already exists git fetch --all + set +e git ls-remote --exit-code --heads origin "refs/heads/${BRANCH}" if [ "$?" -eq 0 ]; then + set -e # if it does, create local branch off existing remote branch git checkout -b "${BRANCH}" "origin/${BRANCH}" git branch --set-upstream-to="origin/${BRANCH}" "${BRANCH}" git pull else + set -e # otherwise, create local branch from main git checkout -b "${BRANCH}" fi @@ -89,8 +92,10 @@ jobs: fi # If a pr is not already open, create one + set +e gh search prs -R redis/docs --state open --match title "redis docs ${RELEASE}" | grep -q "redis docs ${RELEASE}" if [ "$?" -eq 1 ]; then + set -e gh pr create \ --body "redis docs sync ${RELEASE}" \ --title "redis docs sync ${RELEASE}" \