From 51047b1849afab0c5420d042a1b602049189320d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:03:43 +0000 Subject: [PATCH] Use `refs/remote//` to avoid a "Fatal: needed a single revision" error, as we have seen in https://github.com/awslabs/smithy-rs/actions/runs/4105169302/jobs/7082226485 (#2313) --- .github/scripts/get-or-create-release-branch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/get-or-create-release-branch.sh b/.github/scripts/get-or-create-release-branch.sh index 6cdc829911..5ba50856a7 100755 --- a/.github/scripts/get-or-create-release-branch.sh +++ b/.github/scripts/get-or-create-release-branch.sh @@ -59,7 +59,7 @@ else commit_sha=$(git rev-parse --short HEAD) if git ls-remote --exit-code --heads origin "${branch_name}"; then # The release branch already exists, we need to make sure that our commit is its current tip - branch_head_sha=$(git rev-parse --verify --short "refs/heads/${branch_name}") + branch_head_sha=$(git rev-parse --verify --short "refs/remotes/origin/${branch_name}") if [[ "${branch_head_sha}" != "${commit_sha}" ]]; then echo "The release branch - ${branch_name} - already exists. ${commit_sha}, the commit you chose when " echo "launching this release, is not its current HEAD (${branch_head_sha}). This is not allowed: you "