We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5eb7ef2 commit bc61dc5Copy full SHA for bc61dc5
action.yaml
@@ -183,9 +183,10 @@ runs:
183
local input_value="$2"
184
local default_value="$3"
185
186
- if [ ! -z "$input_value" ] && [ "$input_value" != "$default_value" ]; then
+ if [ -n "$input_value" ] && [ "$input_value" != "$default_value" ]; then
187
# If action was provided with explicit input by the caller set that
188
- echo "export $var_name=$input_value" >> trivy_envs.txt
+ # Use printf %q to safely escape special characters and prevent command injection
189
+ printf 'export %s=%q\n' "$var_name" "$input_value" >> trivy_envs.txt
190
fi
191
}
192
0 commit comments