diff --git a/README.md b/README.md index 4ddc60a..ab6f303 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ This action scans the specified `paths` for project files and checks if their fi - **Description**: Enable verbose logging to provide detailed output during the action’s execution, aiding in troubleshooting and setup. - **Required**: No - **Default**: `false` +- **Note**: If workflow run in debug mode, 'verbose-logging' is set to 'true.' ### `fail-on-violation` - **Description**: Set to true to fail the action if any convention violations are detected. Set false to continue without failure. diff --git a/src/filename_inspector.py b/src/filename_inspector.py index 9d774e4..d53b0fb 100644 --- a/src/filename_inspector.py +++ b/src/filename_inspector.py @@ -33,6 +33,8 @@ INPUT_VERBOSE_LOGGING = "INPUT_VERBOSE_LOGGING" INPUT_FAIL_ON_VIOLATION = "INPUT_FAIL_ON_VIOLATION" +RUNNER_DEBUG = "RUNNER_DEBUG" + def get_action_list_input(name: str) -> list[str]: # Note: this is cleanup when input defined by multiple lines @@ -90,7 +92,7 @@ def run(): verbose_logging = get_action_input(INPUT_VERBOSE_LOGGING) == 'true' fail_on_violation = get_action_input(INPUT_FAIL_ON_VIOLATION) == 'true' - if verbose_logging: + if os.getenv(RUNNER_DEBUG, 0) or verbose_logging: logging.getLogger().setLevel(logging.DEBUG) logging.debug(f'Name patterns: {name_patterns}')