Skip to content

Enhance clone-stats workflow to persist history and improve error handling#73

Merged
Sendipad merged 2 commits intodevelopfrom
codex/fix-total-clone-count
Mar 3, 2026
Merged

Enhance clone-stats workflow to persist history and improve error handling#73
Sendipad merged 2 commits intodevelopfrom
codex/fix-total-clone-count

Conversation

@Sendipad
Copy link
Copy Markdown
Owner

@Sendipad Sendipad commented Mar 3, 2026

Motivation

  • Ensure clone metrics survive the GitHub traffic API 14-day window by maintaining a persistent history file.
  • Make the workflow reliable and actionable by requiring a TRAFFIC_TOKEN (classic PAT with repo scope) and surfacing clear error messages for common API failures.
  • Update the public README badge to report all-time clones using the persisted cumulative total.

Description

  • Updated .github/workflows/clone-stats.yml to restore an existing stats/clone_history.json, merge new daily snapshots, compute a total_count, and write stats/clone_history.json and stats/clones.json on each run.
  • Reworked the traffic fetch to require TRAFFIC_TOKEN, capture HTTP status codes from curl, and fail with explicit messages for 401 and 403 responses and other non-2xx responses.
  • Added git add stats/clone_history.json so the history file is committed and pushed to the stats branch.
  • Updated README.md to change the clones badge to read total_count (all-time) and updated stats/README.md to document the new total_count, the stats/clone_history.json artifact, and common troubleshooting for 401/403 errors.

Testing

  • No automated tests were added or run for these workflow and documentation changes.

Codex Task

@Sendipad Sendipad merged commit e389160 into develop Mar 3, 2026
6 checks passed
@Sendipad Sendipad deleted the codex/fix-total-clone-count branch March 3, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant