|
20 | 20 | - uses: actions/checkout@v4
|
21 | 21 | with:
|
22 | 22 | 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 |
23 | 43 | - name: Set up QEMU
|
24 | 44 | uses: docker/setup-qemu-action@v3
|
25 | 45 | - name: Set up Docker Buildx
|
@@ -150,8 +170,12 @@ jobs:
|
150 | 170 | tag_name: ${{ github.ref }}
|
151 | 171 | token: ${{ secrets.GITHUB_TOKEN }}
|
152 | 172 | - 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' |
153 | 176 | run: sleep 900
|
154 | 177 | - name: Trigger dependency bump workflow
|
| 178 | + if: env.BRANCH == 'origin/master' |
155 | 179 | uses: peter-evans/repository-dispatch@v3
|
156 | 180 | with:
|
157 | 181 | token: ${{ secrets.SPINNAKER_GITHUB_TOKEN }}
|
|
0 commit comments