Skip to content

Commit

Permalink
fix: Set env var if it differs from actual value
Browse files Browse the repository at this point in the history
  • Loading branch information
david-marconis committed Nov 28, 2024
1 parent 18f2510 commit 9bd8b96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ runs:
local var_name="$1"
local input_value="$2"
local default_value="$3"
if [ ! -z "$input_value" ] && [ "$input_value" != "$default_value" ]; then
local value="${!var_name}"
if [ ! -z "$input_value" ] && [ "$input_value" != "$default_value" ] || [ "$value" != "$default_value" ]; then
echo "$var_name=$input_value" >> $GITHUB_ENV
fi
}
# Set environment variables, handling those with default values
# cf. https://aquasecurity.github.io/trivy/latest/docs/configuration/#environment-variables
set_env_var_if_provided "TRIVY_INPUT" "${{ inputs.input }}" ""
Expand Down

0 comments on commit 9bd8b96

Please sign in to comment.