From 368af17dd96362a8380c08be4245acc1181d4fbd Mon Sep 17 00:00:00 2001 From: shane knapp Date: Tue, 27 Aug 2024 12:47:23 -0700 Subject: [PATCH] hopefully fixing bash arrays + parsing --- .github/workflows/deploy-hubs.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index a6fd9269e..3f7cc4510 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -37,8 +37,8 @@ jobs: # deploy any hubs that have been labeled for deployment for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do if [[ "$label" == hub-* ]]; then - label=$(echo $label | awk -F'-' '{print $2}') - HUBS+="$label" + hub_name=$(echo $label | awk -F'-' '{print $2}') + HUBS+="$hub_name " echo "DEPLOY=1" >> $GITHUB_ENV fi done @@ -119,11 +119,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Check out the image repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - - name: Pull out any hubs that need deploying from the labels on the merge commit to prod run: | echo "PR labels: ${{ steps.pr-labels.outputs.labels }}" @@ -137,14 +132,20 @@ jobs: # deploy any hubs that have been labeled for deployment for label in $(echo -e "${{ steps.pr-labels.outputs.labels }}"); do if [[ "$label" == hub-* ]]; then - label=$(echo $label | awk -F'-' '{print $2}') - HUBS+="$label" + hub_name=$(echo $label | awk -F'-' '{print $2}') + HUBS+="$hub_name " echo "DEPLOY=1" >> $GITHUB_ENV fi done echo "DEPLOY_HUBS=${HUBS[@]}" >> $GITHUB_ENV fi + - name: Check out the image repo + if: ${{ env.DEPLOY }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - name: Setup python if: ${{ env.DEPLOY }} uses: actions/setup-python@v5