Repository navigation
Track GHCR downloads over time - #142
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a7c7acd7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| gh api --paginate "/users/${{ github.repository_owner }}/packages/container/copilot_here/versions?per_page=100" --jq '.[].download_count // 0' | | ||
| awk '{ total += $1 } END { print total + 0 }' |
There was a problem hiding this comment.
Read download statistics from a supported API field
The documented response schema for this package-versions endpoint does not contain download_count; container versions expose fields such as id, name, timestamps, and metadata. Consequently, // 0 silently converts the missing field to zero for every version, and the workflow records a total of zero rather than actual GHCR downloads. Use an API field that exposes package download statistics, and avoid defaulting a missing metric to a valid count.
Useful? React with 👍 / 👎.
| if git diff --quiet -- docs/ghcr-downloads.csv docs/ghcr-downloads.svg; then | ||
| echo "No statistics changes to commit." | ||
| exit 0 |
There was a problem hiding this comment.
Stage generated files before checking for changes
On the initial run, both generated files are untracked because neither is included in this commit. git diff --quiet compares the working tree with the index and does not report untracked files, as reflected in the git diff documentation, so this condition succeeds and exits before git add. Every subsequent run starts from the same checkout and repeats this behavior, meaning the CSV and SVG are never committed; stage the paths before checking the cached diff, or explicitly account for untracked files.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The workflow cannot obtain valid download counts or publish its initially generated files.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Introduces download-history tracking for the project’s GHCR container image.
Changes:
- Adds a scheduled and manually triggered workflow to collect counts, maintain 90-day CSV history, and generate an SVG chart.
- Adds documentation linking to the chart and raw history.
| File | Description |
|---|---|
| docs/ghcr-downloads.md | Documents the chart, history, and collection limits. |
| .github/workflows/track-ghcr-downloads.yml | Collects statistics, generates artifacts, and attempts to commit updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| run: | | ||
| set -euo pipefail | ||
| total="$( | ||
| gh api --paginate "/users/${{ github.repository_owner }}/packages/container/copilot_here/versions?per_page=100" --jq '.[].download_count // 0' | |
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| if git diff --quiet -- docs/ghcr-downloads.csv docs/ghcr-downloads.svg; then |
| y_span = max(max_count - y_min, 1) | ||
|
|
||
| def x(i): | ||
| return left + (plot_w * i / max(len(points) - 1, 1)) |


Adds a daily GHCR download tracker, stores a rolling 90-day CSV history, generates an SVG trend chart, and adds a documentation page for viewing the chart.
The history begins with the first successful workflow run because GHCR does not expose historical daily download counts retroactively.
Summary by CodeRabbit