From 5e3e8401337118a9461c2fde7aa12ebe3acd47c9 Mon Sep 17 00:00:00 2001 From: jmeridth Date: Wed, 1 Apr 2026 00:04:37 -0500 Subject: [PATCH] fix: compare sponsor_info as bool instead of string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relates to https://github.com/github-community-projects/cleanowners/issues/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 --- contributors.py | 2 +- test_contributors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contributors.py b/contributors.py index dc4e96c..3c8dce9 100644 --- a/contributors.py +++ b/contributors.py @@ -69,7 +69,7 @@ def main(): ) # Get sponsor information on the contributor - if sponsor_info == "true": + if sponsor_info: contributors = contributor_stats.get_sponsor_information( contributors, token, ghe ) diff --git a/test_contributors.py b/test_contributors.py index 4e5910c..1a2883a 100644 --- a/test_contributors.py +++ b/test_contributors.py @@ -419,7 +419,7 @@ def test_main_fetches_sponsor_info_when_enabled(self): "", "", "", - "true", + True, False, "contributors.md", False,