From d5a0e97feaec3f62a52a0b1d885ff4f72cc72bab Mon Sep 17 00:00:00 2001 From: MtnBurrit0 <77340197+mimartin12@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:49:39 -0600 Subject: [PATCH] Fix github.ref comparison in build.yml (#3177) + Convert to case statement + Extend comment --- .github/workflows/build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03d5c419c..0fdd4a14f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -357,14 +357,18 @@ jobs: github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' run: | - # Set proper image based on branch - if [[ "${{ github.ref }}" == "master" ]]; then - SETUP_IMAGE="$_AZ_REGISTRY/setup:dev" - elif [[ "${{ github.ref }}" == "rc" ]]; then - SETUP_IMAGE="$_AZ_REGISTRY/setup:rc" - elif [[ "${{ github.ref }}" == "hotfix-rc" ]]; then - SETUP_IMAGE="$_AZ_REGISTRY/setup:hotfix-rc" - fi + # Set proper setup image based on branch + case "${{ github.ref }}" in + "refs/heads/master") + SETUP_IMAGE="$_AZ_REGISTRY/setup:dev" + ;; + "refs/heads/rc") + SETUP_IMAGE="$_AZ_REGISTRY/setup:rc" + ;; + "refs/heads/hotfix-rc") + SETUP_IMAGE="$_AZ_REGISTRY/setup:hotfix-rc" + ;; + esac STUB_OUTPUT=$(pwd)/docker-stub