Skip to content

Improve clone-stats workflow: dynamic repo, branch handling, and robust fetch/parsing#70

Merged
Sendipad merged 2 commits intodevelopfrom
codex/fix-git-checkout-issue-for-clones.json
Mar 3, 2026
Merged

Improve clone-stats workflow: dynamic repo, branch handling, and robust fetch/parsing#70
Sendipad merged 2 commits intodevelopfrom
codex/fix-git-checkout-issue-for-clones.json

Conversation

@Sendipad
Copy link
Copy Markdown
Owner

@Sendipad Sendipad commented Mar 3, 2026

Motivation

  • Make the clone statistics workflow repository-agnostic by removing a hardcoded repo name and ensure the stats branch exists before updates.
  • Improve robustness of the network fetch and JSON parsing so the action does not fail on missing values or silent curl errors.

Description

  • Add an early step to create/switch to the stats branch with git checkout -B stats before fetching or writing files.
  • Use a dynamic API endpoint with "https://api.github.com/repos/${{ github.repository }}/traffic/clones" instead of a hardcoded repository path.
  • Change curl to use -sS to surface errors and update jq parsing to jq -r '.count // 0' to default to 0 when the field is absent.
  • Create a stats directory, write stats/clones.json, and update git add/commit to include that path while removing the redundant checkout in the commit step.

Testing

  • No automated tests were executed for this workflow file change.

Codex Task

@Sendipad Sendipad merged commit 1c58f36 into develop Mar 3, 2026
6 checks passed
@Sendipad Sendipad deleted the codex/fix-git-checkout-issue-for-clones.json branch March 3, 2026 02:32
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