Commit 33b1b7b
fix: handle empty GitHub API response in github-repo-analyzer
The fetch_repos() function was failing with JSONDecodeError when
gh CLI returned empty output (e.g., in CI without GitHub token).
Fix: Add error handling to check for:
1. Non-zero return code from gh command
2. Empty stdout
3. JSON parsing errors
Returns empty list gracefully instead of crashing, allowing
the script to work in all environments.
Co-Authored-By: Claude (glm-4.7) <noreply@anthropic.com>1 parent 3004790 commit 33b1b7b
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
14 | 31 | | |
15 | 32 | | |
16 | 33 | | |
| |||
0 commit comments