Skip to content

Commit 8ff849d

Browse files
authored
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)
1 parent 15f5d51 commit 8ff849d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# Given a tag, determine what branch we are on, so we can bump dependencies (or not)
2424
- name: Get Branch
2525
run: |
26-
BRANCHES=$(git branch -r --contains ${{ github.ref }})
26+
BRANCHES=$(git branch -r --contains ${{ github.ref }} | grep -v 'HEAD')
2727
echo "BRANCHES is '${BRANCHES}'"
2828
# Check for no branches explicitly...Otherwise echo adds a newline so wc thinks there's
2929
# one branch. And echo -n makes it appears that there's one less branch than there

0 commit comments

Comments
 (0)