Skip to content

Add GitHub cost hygiene guardrails#19

Merged
scottconverse merged 1 commit into
masterfrom
codex/cost-guardrails-20260611
Jun 11, 2026
Merged

Add GitHub cost hygiene guardrails#19
scottconverse merged 1 commit into
masterfrom
codex/cost-guardrails-20260611

Conversation

@scottconverse

Copy link
Copy Markdown
Owner

Adds non-destructive GitHub resource guardrails:

  • explicit artifact retention where uploads were missing it
  • top-level concurrency cancellation for push/PR workflows where missing
  • a manual Cost Hygiene Check workflow that reports artifacts/caches without deleting anything
  • a short cost-hygiene policy covering Packages, Releases, Codespaces, and multi-OS CI

This PR intentionally does not delete artifacts, caches, releases, LFS objects, packages, or change repo visibility.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +31 to +32
artifacts_json="$(gh api "/repos/${GITHUB_REPOSITORY}/actions/artifacts?per_page=100")"
caches_json="$(gh api "/repos/${GITHUB_REPOSITORY}/actions/caches?per_page=100")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@scottconverse scottconverse marked this pull request as draft June 11, 2026 20:24
@scottconverse scottconverse marked this pull request as ready for review June 11, 2026 20:33
@scottconverse scottconverse merged commit deabf5c into master Jun 11, 2026
0 of 7 checks passed
@scottconverse scottconverse deleted the codex/cost-guardrails-20260611 branch June 11, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant