From c97668a744d2dd0825db306802c241d71df37cd5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 14 Sep 2026 10:34:49 -0700 Subject: [PATCH] send logs to stderr most logs are sent to stderr (important for using pipe to capture output), but a few recent print statements were missed --- github_activity/github_activity.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/github_activity/github_activity.py b/github_activity/github_activity.py index 45d483b..fa69e30 100644 --- a/github_activity/github_activity.py +++ b/github_activity/github_activity.py @@ -944,7 +944,7 @@ def _get_datetime_from_git_ref(org, repo, ref, token): except requests.exceptions.HTTPError: try: data = response.json() - print(f"\n!! GitHub error: {data['message']}\n") + print(f"\n!! GitHub error: {data['message']}\n", file=sys.stderr) except Exception: pass raise @@ -963,8 +963,8 @@ def _get_latest_release_tag(org, repo): "--json", "tagName,name,publishedAt", ] - print(f"Auto-detecting latest release tag for: {org}/{repo}") - print(f"Running command: {' '.join(cmd)}") + print(f"Auto-detecting latest release tag for: {org}/{repo}", file=sys.stderr) + print(f"Running command: {' '.join(cmd)}", file=sys.stderr) out = run(cmd, stdout=PIPE) try: json = out.stdout.decode() @@ -972,11 +972,16 @@ def _get_latest_release_tag(org, repo): tag = release_data["tagName"] release = release_data["name"] published_at = release_data["publishedAt"] - print(f"Using tag {tag} from release {release} published at {published_at}") + print( + f"Using tag {tag} from release {release} published at {published_at}", + file=sys.stderr, + ) return tag except Exception as e: - print(f"Error getting latest release tag for {org}/{repo}: {e}") - print("Reverting to using latest local git tag...") + print( + f"Error getting latest release tag for {org}/{repo}: {e}", file=sys.stderr + ) + print("Reverting to using latest local git tag...", file=sys.stderr) out = run("git describe --tags".split(), stdout=PIPE) tag = out.stdout.decode().rsplit("-", 2)[0] return tag