Skip to content

Commit 51de041

Browse files
codespace: use default input values
Issue: ZENKO-5096
1 parent c05f731 commit 51de041

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.devcontainer/setup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export E2E_IMAGE_TAG=latest
88

99
GITHUB_ENV=$(mktemp /tmp/github_env.XXXXXX)
1010

11+
for input in $(yq '.inputs | to_entries | .[] | .key + "=" + .value.default' .github/actions/deploy/action.yaml); do
12+
inputName=GITHUB_INPUTS_${input%=*}
13+
[ -z "${!inputName}" ] && export GITHUB_INPUTS_$input
14+
done
15+
1116
array_length=$(yq ".runs.steps | length - 1" .github/actions/deploy/action.yaml)
1217
for i in $(seq 0 $array_length); do
1318
#step=$(yq ".runs.steps[$i]" .github/actions/deploy/action.yaml)
@@ -24,7 +29,8 @@ for i in $(seq 0 $array_length); do
2429
# Inject variables
2530
# We use `sed` to replace github variable references and avoid bad substitution error from bash
2631
env_variables=$(yq '.runs.steps['$i'].env | to_entries | .[] | .key + "=" + .value' .github/actions/deploy/action.yaml \
27-
| sed 's/\${{.*}}//')
32+
| sed -e 's/${{ *inputs.\([[:graph:]]*\) *}}/$GITHUB_INPUTS_\1/' -e 's/\${{.*}}//' \
33+
| envsubst )
2834
[ -n "$env_variables" ] && export $env_variables
2935

3036
if [ "$working_dir" != "null" ]; then

0 commit comments

Comments
 (0)