Skip to content

Commit 8452e4e

Browse files
authored
fix: compare sponsor_info as bool instead of string (#446)
Relates to github-community-projects/cleanowners#373 ## What Changed the sponsor_info gate in contributors.py from a string comparison (`== "true"`) to a truthy check, and updated the test mock to return a bool to match what get_bool_env_var actually returns. ## Why get_bool_env_var returns a Python bool, but the comparison checked for the string "true". Since `True == "true"` is always False, sponsor information was never fetched regardless of the SPONSOR_INFO env var setting. ## Notes - markdown.py already has `_is_truthy()` that handles both types, so the rendering side was not affected — only the data fetch was skipped. - json_writer.py passes sponsor_info through without comparison, so it's also unaffected. Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent 3ba51bd commit 8452e4e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

contributors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def main():
6969
)
7070

7171
# Get sponsor information on the contributor
72-
if sponsor_info == "true":
72+
if sponsor_info:
7373
contributors = contributor_stats.get_sponsor_information(
7474
contributors, token, ghe
7575
)

test_contributors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def test_main_fetches_sponsor_info_when_enabled(self):
419419
"",
420420
"",
421421
"",
422-
"true",
422+
True,
423423
False,
424424
"contributors.md",
425425
False,

0 commit comments

Comments
 (0)