Skip to content

Commit

Permalink
move get-envs outputs to when setting the arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ebronson68 committed Nov 20, 2023
1 parent 26585da commit ee27a50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ephemeral-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ jobs:
run: |
REPOSITORY_NAME=$(echo "${{ github.event.repository.name }}" | awk -F '_' '{print $1}' | tr -d "-")
HOSTNAME="${{ needs.deploy.outputs.hostname }}"
ENVIRONMENT_VARIABLES="${{ steps.get-envs.outputs.environmentVariables }}"
BUILDARGS="${{ steps.get-envs.outputs.buildArguments }}"
ENVIRONMENT_VARIABLES=""
BUILDARGS=""
# Replace URL in ENVIRONMENT_VARIABLES
IFS=' ' read -r -a ENVVARS_ARRAY <<< "${ENVIRONMENT_VARIABLES}"
IFS=' ' read -r -a ENVVARS_ARRAY <<< "${{ steps.get-envs.outputs.environmentVariables }}"
for VAR in "${ENVVARS_ARRAY[@]}"; do
if echo "${VAR}" | grep -Eq "localhost|${REPOSITORY_NAME}.com";then
VAR=$(echo "${VAR}" | awk -F '=' '{print $1}' | sed "s|$|=${HOSTNAME}|g")
Expand All @@ -229,7 +229,7 @@ jobs:
done
# Replace URL in BUILDARGS
IFS=' ' read -r -a BUILDARGS_ARRAY <<< "${BUILDARGS}"
IFS=' ' read -r -a BUILDARGS_ARRAY <<< "${{ steps.get-envs.outputs.buildArguments }}"
for VAR in "${BUILDARGS_ARRAY[@]}"; do
if echo "${VAR}" | grep -Eq "localhost|${REPOSITORY_NAME}.com";then
VAR=$(echo "${VAR}" | awk -F '=' '{print $1}' | sed "s|$|=${HOSTNAME}|g")
Expand Down

0 comments on commit ee27a50

Please sign in to comment.