From 8ff849d6e753a0d5aac4f846963f7b18d13b8f0f Mon Sep 17 00:00:00 2001 From: David Byron <82477955+dbyron-sf@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:37:10 -0800 Subject: [PATCH] fix(gha): fix branch detection error (#6350) from e.g. https://github.com/spinnaker/clouddriver/actions/runs/13418069226/job/37483771864 Run BRANCHES=$(git branch -r --contains refs/tags/v5.91.0) BRANCHES is ' origin/HEAD -> origin/master origin/master' NUM_BRANCHES is '2' exactly one branch required to release clouddriver, but there are 2 ( origin/HEAD -> origin/master origin/master) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c23276e975..92ec403ece 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: # Given a tag, determine what branch we are on, so we can bump dependencies (or not) - name: Get Branch run: | - BRANCHES=$(git branch -r --contains ${{ github.ref }}) + BRANCHES=$(git branch -r --contains ${{ github.ref }} | grep -v 'HEAD') echo "BRANCHES is '${BRANCHES}'" # Check for no branches explicitly...Otherwise echo adds a newline so wc thinks there's # one branch. And echo -n makes it appears that there's one less branch than there