mirror of
https://github.com/aquasecurity/trivy-action.git
synced 2026-05-14 03:02:40 +00:00
Merge commit from fork
This commit is contained in:
+3
-2
@@ -183,9 +183,10 @@ runs:
|
|||||||
local input_value="$2"
|
local input_value="$2"
|
||||||
local default_value="$3"
|
local default_value="$3"
|
||||||
|
|
||||||
if [ ! -z "$input_value" ] && [ "$input_value" != "$default_value" ]; then
|
if [ -n "$input_value" ] && [ "$input_value" != "$default_value" ]; then
|
||||||
# If action was provided with explicit input by the caller set that
|
# If action was provided with explicit input by the caller set that
|
||||||
echo "export $var_name=$input_value" >> trivy_envs.txt
|
# Use printf %q to safely escape special characters and prevent command injection
|
||||||
|
printf 'export %s=%q\n' "$var_name" "$input_value" >> trivy_envs.txt
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user