Skip to content

Commit

Permalink
fix: trim projects after splitting from commas
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandonogueira authored May 31, 2023
1 parent f7c3b9a commit 40c3061
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/actions/image-tagger/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ runs:
shell: bash
run: |
set -ex
IFS="," read -ra PROJECTS <<< "${{ inputs.projects }}"
REGISTRY="${{ inputs.registry }}"
PROJECTS_SANITIZED=$(echo "${{ inputs.projects }}" | tr -d '\n')
IFS="," read -ra PROJECTS <<< "$PROJECTS_SANITIZED"
FAILED=""
for PROJECT in "${PROJECTS[@]}"; do
PROJECT_SANITIZED=$(echo "$PROJECT" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
EXIT_CODE=0
gcloud artifacts docker tags add $REGISTRY/$PROJECT:${{ inputs.version }} $REGISTRY/$PROJECT:${{ inputs.version }}-${{ inputs.environment }} > /dev/null || EXIT_CODE=$?
if [ "$EXIT_CODE" -ne "0" ]; then
Expand Down

0 comments on commit 40c3061

Please sign in to comment.