Fetch star count from GitHub API.
()
| 24 | |
| 25 | |
| 26 | def get_github_stars() -> int: |
| 27 | """Fetch star count from GitHub API.""" |
| 28 | try: |
| 29 | response = requests.get(GITHUB_API_URL, timeout=30) |
| 30 | response.raise_for_status() |
| 31 | data = response.json() |
| 32 | return data.get("stargazers_count", 0) |
| 33 | except Exception as e: |
| 34 | print(f"Error fetching stars: {e}") |
| 35 | sys.exit(1) |
| 36 | |
| 37 | |
| 38 | def update_readme_stars_badge(filepath: Path, stars: int) -> bool: |
no test coverage detected