Skip to content

Commit

Permalink
Fix optional input
Browse files Browse the repository at this point in the history
  • Loading branch information
victowang committed Jul 15, 2024
1 parent 5607b93 commit e2cd2ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ else
exit 1
fi

if [[ "$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_POLL_SCAN_RESULTS" == "true" ]]; then
# Default value for POLL_SCAN_RESULTS
POLL_SCAN_RESULTS="${BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_POLL_SCAN_RESULTS:-false}"

if [[ "$POLL_SCAN_RESULTS" == "true" ]]; then
echo "POLL_SCAN_RESULTS is true"
if [ -z "$DT_MOBILE_RESULTS_API_KEY" ]; then
echo "Error: Environment variable RESULTS_API_KEY must be set when POLL_SCAN_RESULTS is set to true."
Expand Down Expand Up @@ -119,7 +122,7 @@ for (( retry = 0; retry < maxRetries; retry++ )); do
echo "Retrying... ($((retry + 1))/$maxRetries)"
done

if $upload_success && [[ "$BUILDKITE_PLUGIN_DATA_THEOREM_MOBILE_SECURE_POLL_SCAN_RESULTS" == "true" ]]; then
if $upload_success && [[ "$POLL_SCAN_RESULTS" == "true" ]]; then
echo "Polling for scan status: scan id=$scan_id"

start_time=$(date +%s)
Expand Down

0 comments on commit e2cd2ea

Please sign in to comment.