From 26c3ebce59e7f4cacfdeb4e4fe3b78eb4c4c879b Mon Sep 17 00:00:00 2001 From: bounty-hunter Date: Tue, 28 Jul 2026 22:51:11 +0800 Subject: [PATCH] fix: resolve #1 (stderr token refresh logs) --- README.md | 4 +++- main.go | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e510a66..3f90757 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# cli \ No newline at end of file +# cli + +Auth refresh logs go to stderr; stdout stays JSON-clean. diff --git a/main.go b/main.go index 49f4dee..a1023f7 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,23 @@ package main -import "fmt" +import ( + "fmt" + "os" +) + +// refreshInstallationToken simulates GitHub App token refresh logging. +// Logs must go to stderr so stdout stays machine-readable (e.g. JSON). +func refreshInstallationToken() error { + fmt.Fprintln(os.Stderr, "refreshing GitHub App installation token...") + fmt.Fprintln(os.Stderr, "installation token refreshed") + return nil +} func main() { - fmt.Println("Hello, Bounty Hunter!") + if err := refreshInstallationToken(); err != nil { + fmt.Fprintln(os.Stderr, "token refresh failed:", err) + os.Exit(1) + } + // Primary command output stays on stdout only. + fmt.Println(`{"ok":true,"repo":"cli"}`) }