From 66920fda77a73ef4d9baa18a4bf353f6f0ad3bdc Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 15 Sep 2022 11:07:05 +0200 Subject: [PATCH] .github: do not create a pull request when branch exists If git show-ref returns an error, i.e. the branch already exists, then we should not create a pull request, but simply return error. Otherwise, the Github Actions would always try to create pull requests even when the branch still exists. --- .../src/third_party/coreos-overlay/.github/workflows/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 6c6e1ba0cd..363c650e3a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -70,6 +70,7 @@ function checkout_branches() { if git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" show-ref "remotes/origin/${TARGET_BRANCH}"; then echo "Target branch already exists. exit."; + return 1 fi # Each submodule directory should be explicitly set from BASE_BRANCH,