Add GitHub cost hygiene guardrails#19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d45f2852b1
ℹ️ 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".
| artifacts_json="$(gh api "/repos/${GITHUB_REPOSITORY}/actions/artifacts?per_page=100")" | ||
| caches_json="$(gh api "/repos/${GITHUB_REPOSITORY}/actions/caches?per_page=100")" |
There was a problem hiding this comment.
Page through artifacts before totaling storage
When a repository has more than 100 retained artifacts or caches, these gh api calls only fetch the first page (per_page=100), while the script reports .total_count for all pages but sums size_in_bytes only from that first page. GitHub REST responses are paginated for large result sets, and gh api --paginate is the documented way to make additional requests, so the Cost Hygiene Check can substantially under-report storage exactly in the high-usage cases it is meant to diagnose.
Useful? React with 👍 / 👎.
Adds non-destructive GitHub resource guardrails:
This PR intentionally does not delete artifacts, caches, releases, LFS objects, packages, or change repo visibility.