Skip to content

Commit

Permalink
hopefully fixing bash arrays + parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneknapp committed Aug 27, 2024
1 parent 3bf0079 commit 368af17
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/deploy-hubs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"
Expand All @@ -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
Expand Down

0 comments on commit 368af17

Please sign in to comment.