Skip to main content

milo-gh-actions-cost-audit

Audit your GitHub Actions workflows for cost waste. Free CLI. Free public-repo API. Paid Lightning-rail webhook alerts.

Lightning License: MIT Audited

Why this exists

GitHub Actions billing is opaque until your card is charged. 7 rules — derived from real-world overspend patterns (matrix.os explosion, missing cache, no timeout-minutes, oversized runners, duplicate runs on push+pr, unfiltered cron) — surface waste in under one second. Estimated savings per issue are quoted in dollars per month.

No GitHub token required for public repos. No telemetry. MIT.


3 example usages

1. CLI (local file)

pip install milo-gh-actions-cost-audit
milo-gh-actions-cost-audit .github/workflows/ci.yml
milo-gh-actions-cost-audit — CI
===============================

Jobs: 1   Triggers: push, pull_request   Runs/mo (assumed): 30
Estimated monthly cost (if private repo): $190.80
Estimated annual cost: $2289.60

Found 5 issue(s):  high=3 med=2 low=0
Total potential monthly savings: $580.86  ($6970.32/yr)

1. [HIGH] macos-large-runner (oversized_runner)
   Jobs:  test
   Fix:   Job 'test' uses macos-latest-large. macos-latest-large is $0.32/min
          vs $0.08/min for macos-latest. ... Saves: $432.00/mo ($5184.00/yr)
... (truncated)

Exit code: 0 if no high-severity issues, 1 if 1+ high-severity issues.

2. Hosted API (free, public repo)

# Free POST — any workflow YAML
curl -X POST https://gh-cost.milo.dev/audit \
  -H "Content-Type: text/plain" \
  --data-binary @.github/workflows/ci.yml

# Free GET — public repo, rate-limited 10/IP/day
curl "https://gh-cost.milo.dev/audit?repo=vercel/next.js"

3. Webhook alerts (Lightning, 100 sats/month)

# 1. Request subscription — returns HTTP 402 with BOLT-11 invoice
curl -i -X POST https://gh-cost.milo.dev/webhook/subscribe \
  -H "Content-Type: application/json" \
  -d '{"repo": "your/repo", "webhook_url": "https://your-app.com/hook"}'

# 2. Pay the BOLT-11 in any Lightning wallet (Alby, Phoenix, Zeus, WoS)

# 3. Re-call with ?payment_hash=<hash-from-402>
curl -X POST "https://gh-cost.milo.dev/webhook/subscribe?payment_hash=<hash>" \
  -H "Content-Type: application/json" \
  -d '{"repo": "your/repo", "webhook_url": "https://your-app.com/hook"}'

You get a daily audit at 03:00 UTC. If any high-severity issue appears OR the estimated monthly cost increases by >$5 from baseline, your webhook_url is called with the full audit JSON.


"Audited by" badge

Add this to your repo's README after auditing your workflows:

[![Audited](https://img.shields.io/badge/audited%20by-milo--gh--actions--cost--audit-success)](https://github.com/miloantaeus/milo-gh-actions-cost-audit)

Rules (current set)

ID Severity What it catches
matrix-os-3plus med strategy.matrix.os with 3+ OSes — usually you don't actually test OS compatibility
no-timeout-minutes high Missing timeout-minutes: — infinite-loop risk = unbounded billing
no-actions-cache med Job installs dependencies but lacks actions/cache@v4 or cache: true
macos-large-runner high macos-latest-large ($0.32/min) when macos-latest ($0.08/min) usually works
duplicate-job-on-pr-and-push high Workflow triggers on both push (unrestricted) AND pull_request — 2x cost per PR commit
ubuntu-latest-large-no-need med 8/16-core runner without parallel build commands (make -j, cargo --release, etc.)
schedule-without-condition low schedule: cron without paths: filter on push/pr — needless baseline cron

Architecture

  • Pure-Python parser (PyYAML); no external API calls for local audits.
  • Public-repo audits use GitHub's unauthenticated REST API (60 req/hr/IP global cap).
  • Lightning paywall via milo-paywall-kit (LNBits/Alby compatible).
  • FastAPI hosted endpoint deployable to Vercel/Fly/Railway.

Tests

pip install -e ".[test]"
pytest -q
# 63 passed in 0.19s

Self-deprecation criterion

Per Milo's market-truth doctrine, this SKU is deprecated if:

  • 0 webhook subscribers convert in 60 days (validates paid-tier demand), OR
  • 0 GitHub-API audits in 30 days (validates free-tier demand).

Either signal kills it without owner intervention.


License

MIT.

Metadata

Release files for milo-gh-actions-cost-audit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for milo-gh-actions-cost-audit 0.1.0
File Interpreter ABI Platform Actions
milo_gh_actions_cost_audit-0.1.0-py3-none-any.whl Python 3 none any Details for milo_gh_actions_cost_audit-0.1.0-py3-none-any.whl

Release files / milo_gh_actions_cost_audit-0.1.0-py3-none-any.whl

Download URL milo_gh_actions_cost_audit-0.1.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa07dbd050d580f6881660a2d8d8b9d05afd16f61307a516097def5e008a90da
BLAKE2b-256 checksum
How to use checksums
5468bbbbd68a81e9dd24f77a905ab263b30f4edbe058c9d7ace2ed2d090d78b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for milo-gh-actions-cost-audit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page