Skip to content

Conversation

@dc-larsen
Copy link

Summary

  • Fixes a bug where CLI argument defaults (empty strings) were incorrectly overwriting values loaded from environment variables and the Socket Basics API dashboard config
  • Changes the condition from if arg_value is not None to if arg_value for non-bool types

Problem

When CLI arguments with empty string defaults (like --dockerfiles) are not explicitly provided by the user, they were overwriting non-empty values from:

  1. Environment variables (e.g., INPUT_DOCKERFILES set via GitHub Actions workflow)
  2. Socket Basics API config (dashboard settings)

This caused Dockerfile scanning to fail even when correctly configured in the dashboard with dockerfiles: "Dockerfile", because the CLI default of "" would wipe out that value.

Root Cause

# Before: empty string passes this check
if arg_value is not None:
    config_dict[param_name] = arg_value  # Overwrites with ""

Fix

# After: empty string is falsy, won't override
if arg_value:
    config_dict[param_name] = arg_value

Test plan

  • Verified dashboard API returns correct dockerfiles: "Dockerfile" value
  • Test Dockerfile scanning with dashboard config only (no workflow input)
  • Test Dockerfile scanning with explicit workflow input
  • Test that explicit CLI args still override when provided

When CLI arguments with empty string defaults (like --dockerfiles) are not
explicitly provided by the user, they were incorrectly overwriting non-empty
values loaded from environment variables or the Socket Basics API config.

The issue was that the check `if arg_value is not None` passed for empty
strings, causing `config_dict['dockerfiles'] = ""` to wipe out the value
from the dashboard config.

Changed the condition to `if arg_value` (truthy check) for non-bool types,
so empty string defaults don't override actual config values.

This fixes Dockerfile scanning not working when configured via the Socket
dashboard, as the `dockerfiles` value was being cleared by the CLI default.
@dc-larsen dc-larsen requested a review from a team as a code owner December 20, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants