Skip to content

Commit b0a6abc

Browse files
authored
Merge pull request #9 from nrkno/multi-value-support
2 parents 46f460c + c1c1d8d commit b0a6abc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

entrypoint.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
#!/bin/bash
22

3-
VARIABLES="$(python3 /home/runuser/setenv.py)"
3+
if [[ -v "${INPUT_VAULT_SECRET}" ]]; then
4+
IFS=',' read -ra SECRET_ENTRIES <<< "$INPUT_VAULT_SECRET"
5+
vault_entries=""
6+
for ENTRY in "${SECRET_ENTRIES[@]}"; do
7+
echo "Processing vault secret entry: $ENTRY"
8+
vault_entry=" --vault-secret \"$ENTRY\""
9+
vault_entries="${vault_entries} ${vault_entry}"
10+
done
11+
fi
12+
13+
if [[ -v "${INPUT_GCP}" ]]; then
14+
IFS=',' read -ra GCP_ENTRIES <<< "$INPUT_GCP"
15+
gcp_entries=""
16+
for ENTRY in "${GCP_ENTRIES[@]}"; do
17+
echo "Processing gcp project entry: $ENTRY"
18+
gcp_entry=" --gcp \"$ENTRY\""
19+
gcp_entries="${gcp_entries}${gcp_entry}"
20+
done
21+
fi
22+
23+
VARIABLES="$(python3 /home/runuser/setenv.py${vault_entries}${gcp_entries})"
424

525
if [[ -z "$VARIABLES" ]]; then
626
echo "No variables set. Exiting."

0 commit comments

Comments
 (0)