Skip to content

Commit 2e8758c

Browse files
committed
fix: gh actions
1 parent 84eac94 commit 2e8758c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

generate-yaml-rp-env.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -e
23

34
# Check if source directory path is provided
45
if [ $# -eq 0 ]; then
@@ -32,7 +33,16 @@ process_file() {
3233
env_value="${!var_name}"
3334

3435
if [[ -n "$env_value" ]]; then
36+
# Special handling for CIS_CREDENTIAL or similar JSON structures
37+
if [[ "$var_name" == "CIS_CREDENTIAL" ]] || [[ "$var_name" == "CIS_CENTRAL_BINDING" ]]; then
38+
39+
# Process with jq and then clean up the escaped newlines
40+
clean_value=$(echo "$env_value" | jq -c .)
41+
line="${line//INJECT_ENV.${var_name}/${clean_value}}"
42+
else
43+
# For non-JSON variables, use direct substitution
3544
line="${line//INJECT_ENV.${var_name}/${env_value}}"
45+
fi
3646
else
3747
echo "Warning: Environment variable $var_name is not set or empty. Leaving placeholder unchanged."
3848
fi

0 commit comments

Comments
 (0)