Skip to content

Commit 46c42ce

Browse files
fix(gha): only bump halyard on master (#6268) (#6269)
Since halyard uses a different versioning scheme, it doesn't make sense for halyard to consume non-master (e.g. release-1.34.x) versions of clouddriver. (cherry picked from commit 33323d4) Co-authored-by: David Byron <82477955+dbyron-sf@users.noreply.github.com>
1 parent a8879b8 commit 46c42ce

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23+
# Given a tag, determine what branch we are on, so we can bump dependencies (or not)
24+
- name: Get Branch
25+
run: |
26+
BRANCHES=$(git branch -r --contains ${{ github.ref }})
27+
echo "BRANCHES is '${BRANCHES}'"
28+
# Check for no branches explicitly...Otherwise echo adds a newline so wc thinks there's
29+
# one branch. And echo -n makes it appears that there's one less branch than there
30+
# actually is.
31+
if [ -z "$BRANCHES" ]; then
32+
echo "exactly one branch required to release clouddriver, but there are none"
33+
exit 1
34+
fi
35+
NUM_BRANCHES=$(($(echo "$BRANCHES" | wc -l)))
36+
echo "NUM_BRANCHES is '${NUM_BRANCHES}'"
37+
if [ $NUM_BRANCHES -ne 1 ]; then
38+
echo "exactly one branch required to release clouddriver, but there are $NUM_BRANCHES ($BRANCHES)"
39+
exit 1
40+
fi
41+
echo "exactly one branch ($BRANCHES)"
42+
echo BRANCH=$BRANCHES >> $GITHUB_ENV
2343
- name: Set up QEMU
2444
uses: docker/setup-qemu-action@v3
2545
- name: Set up Docker Buildx
@@ -150,8 +170,12 @@ jobs:
150170
tag_name: ${{ github.ref }}
151171
token: ${{ secrets.GITHUB_TOKEN }}
152172
- name: Pause before dependency bump
173+
# The only dependency to bump is halyard, which only consumes from
174+
# master since it has a different versioning scheme.
175+
if: env.BRANCH == 'origin/master'
153176
run: sleep 900
154177
- name: Trigger dependency bump workflow
178+
if: env.BRANCH == 'origin/master'
155179
uses: peter-evans/repository-dispatch@v3
156180
with:
157181
token: ${{ secrets.SPINNAKER_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)