fix(github-action): handle string "false" for ENABLE_OUTPUT setting#2319
Open
fix(github-action): handle string "false" for ENABLE_OUTPUT setting#2319
Conversation
When ENABLE_OUTPUT is set via environment variables or YAML config, it arrives as a string. A non-empty string like "false" is truthy in Python, so `if enable_output:` would incorrectly evaluate to True. This adds explicit string-to-boolean coercion at both the point where the setting is read (github_action_runner.py) and where it is consumed (utils.py), handling "false", "0", "no", and empty string as falsy values. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Review Summary by QodoFix string "false" truthiness for ENABLE_OUTPUT setting
WalkthroughsDescription• Handle string "false" for ENABLE_OUTPUT setting in GitHub Actions - Added explicit string-to-boolean coercion treating "false", "0", "no", and "" as falsy - Applied fix at both ingestion point (github_action_runner.py) and consumption point (utils.py) • Added two new test cases verifying string boolean handling - test_github_action_output_disabled_string_false validates "false" disables output - test_github_action_output_enabled_string_true validates "true" enables output Diagramflowchart LR
A["Environment Variables<br/>YAML Config"] -->|"String 'false'<br/>arrives as string"| B["github_action_runner.py<br/>Coerce to boolean"]
B -->|"Boolean value"| C["get_settings()"]
C -->|"Retrieve setting"| D["utils.py<br/>github_action_output"]
D -->|"Coerce if string"| E["Check enable_output<br/>value"]
E -->|"False"| F["Skip output write"]
E -->|"True"| G["Write to GITHUB_OUTPUT"]
File Changes1. pr_agent/algo/utils.py
|
Contributor
Code Review by Qodo
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GITHUB_ACTION_CONFIG.ENABLE_OUTPUTcan arrive as a string"false"from environment variables or YAML config. Since non-empty strings are truthy in Python,if enable_output:evaluates toTrueeven when the user explicitly set it to"false", causing unwanted GitHub Action output writes.github_action_runner.py) and the consumption point (utils.py), treating"false","0","no", and""as falsy."false"disables output and string"true"enables it.Test plan
True, boolFalse, not set, error case)test_github_action_output_disabled_string_false— string"false"does not write toGITHUB_OUTPUTtest_github_action_output_enabled_string_true— string"true"correctly writes toGITHUB_OUTPUTenable_output: "false"in a GitHub Action workflow and verify no output is written🤖 Generated with Claude Code