Ship Cost Visibility Into Every PR: CloudExpat's GitHub Action Now Surfaces Savings Insights

/images/blog/posts/github-action-enhanced-report.png

CloudExpat brings cost optimization into pull requests — so engineers fix waste before it ships. The GitHub Action now posts a health-scored report with savings insights, budget tracking, and carbon data directly into your PRs.

/images/blog/posts/github-action-enhanced-report.png

Engineers don’t ignore cost data because they don’t care. They ignore it because it shows up in the wrong place, at the wrong time, with no clear action to take.

We rebuilt the CloudExpat GitHub Action around a simple idea: cost decisions happen during code review, not after deployment. Instead of a generic weekly cost dump, it now posts a health-scored report with specific savings opportunities — directly into your pull requests.

CloudExpat GitHub Action PR comment showing cost health score, savings opportunities, and budget tracking

One bold headline: health grade, weekly spend, and how much you could save. Everything else collapses by default — expand what you need, skip what you don’t.


Not a Cost Diff — An Optimization Report

Most cost-in-CI tools show you a diff: “this PR will cost $X more.” That’s useful for infrastructure changes, but it misses the bigger picture. Your staging environment running 24/7 doesn’t show up in a Terraform diff. Neither does the unattached EBS volume from three sprints ago.

CloudExpat takes a different approach. Instead of estimating what a PR will cost, it shows what your infrastructure is costing — and what you can do about it right now.

Cost diff toolsCloudExpat
Estimate future cost of IaC changesSurface existing waste and optimization opportunities
Require Terraform/OpenTofu integrationWork with any repo — no IaC dependency
Show cost impact of the current PRShow cost health across all connected accounts
InformationalActionable — ranked insights with savings estimates

Both approaches have value. But if your goal is to actually reduce cloud spend, knowing that “you have an oversized m5.2xlarge running at 12% CPU” is more actionable than “this PR adds $0.03/hour.”


What the Report Includes

Cost Health Score (A–F)

Every report opens with a letter grade. The score is computed from:

  • Waste percentage — potential savings vs. total spend
  • Unaddressed high-priority insights — the longer they sit, the lower the score
  • Spend trend — cost spikes above 20% week-over-week pull the grade down

An engineering team at A doesn’t need a FinOps review. A team at D does. One signal, no ambiguity.

Savings Insights — Ranked by Impact

The report surfaces the top 3 optimization opportunities by estimated monthly savings:

#IssueResourceSavingsPriority
1Oversized Instancesi-0abc123 (m5.2xlarge)$420/moHigh
2Dev/Test Always-Oni-0def456 (staging-api)$310/moMedium
3Unattached EBS Volumevol-0789abc$160/moMedium

These aren’t theoretical. They’re generated by CloudExpat’s insight engine, which analyzes actual resource usage across all connected accounts.

How Insights Are Generated

The engine evaluates resources against specific thresholds:

  • Utilization signals — CPU, memory, network throughput, database connections (sampled over 14-day windows)
  • State checks — attachment status, target group membership, association status
  • Tag analysis — environment tags (dev/test/staging) matched against running hours
  • Pricing data — current on-demand rates used to estimate dollar savings

Each insight is classified by priority (high/medium/low) based on savings magnitude and confidence level.


Insight Types Covered

Compute Waste

  • Oversized instances — large instance types running at consistently low CPU
  • Dev/test always-on — non-production resources running 24/7 (60–70% savings potential)

Storage Waste

  • Unattached EBS volumes — storage you’re paying for but not using
  • Unattached disks — same pattern on Azure and GCP

Networking Waste

  • Unassociated Elastic IPs — idle public IPs ($3.65/mo each since Feb 2024)
  • Idle load balancers — ALBs and CLBs with no active targets

Database Optimization

  • Database underutilization — RDS instances at <25% connection capacity

Commitment Optimization

  • Reserved Instance opportunities — EC2, RDS, ElastiCache, Redshift
  • Savings Plan opportunities — Compute and EC2 plans with 30–72% potential

Each insight links to the CloudExpat dashboard for the full list and implementation details.


Budget Tracking With Burn Rate

If you’ve configured budgets in CloudExpat, the report includes:

  • Current spend vs. budget — with percentage used
  • Daily burn rate — so you can see if you’re accelerating
  • Projected end-of-period spend — with overrun amount if applicable
  • Days remaining — straightforward countdown

A team at 68% of budget on day 18 is on track. A team at 85% on day 12 is not — and now everyone on the PR knows it before the month-end surprise.


Collapsible by Default

GitHub renders <details> tags natively. The report uses them for every section:

  • Cost Summary — account-by-account breakdown with week-over-week change
  • Savings Opportunities — top insights table
  • Budget Status — burn rate and projections
  • Carbon Footprint — emissions by account with trend

A PR might have 5 reviewers — the lead cares about budget, the platform engineer cares about the oversized instance, and the rest just want to see the grade and move on. Collapsible sections let each person engage at their level.


Configuration: .cloudexpat.yml

Scope reports to a specific service by adding a config file to your repo root:

service: payments-api
tags:
  service: payments
  environment: production

The action reads this automatically and passes the filters to the API. Different repos get reports scoped to the resources they own — not a global cost dump.

You can also pass service and tags as action inputs directly:

- uses: CloudExpat/cost-report@v1
  with:
    api-key: ${{ secrets.CLOUDEXPAT_API_KEY }}
    service: payments-api
    tags: 'environment:production,team:platform'

Try It on Your Next PR

Most teams find their first savings opportunity within the first couple of pull requests. Setup takes under 5 minutes.

1. Get an API key from Settings > API Keys

2. Add it as a GitHub secret (CLOUDEXPAT_API_KEY) in your repo settings

3. Create the workflow at .github/workflows/cloudexpat.yml:

name: CloudExpat Cost Report

on:
  pull_request:
  workflow_dispatch:

permissions:
  pull-requests: write

jobs:
  cost-report:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: CloudExpat/cost-report@v1
        with:
          api-key: ${{ secrets.CLOUDEXPAT_API_KEY }}

Every PR now gets a cost report with savings insights. The action tries the enhanced endpoint first and falls back to the basic report automatically — existing workflows won’t break.


Cloud Cost in Pull Requests: Why It Matters

FinOps programs fail when cost visibility is separated from engineering workflows. Dashboards are useful for monthly reviews. But the day-to-day decisions — which instance type, whether to leave staging running, whether that EBS volume is still needed — happen in code, reviewed in PRs.

The pattern is simple: shift cost decisions left. Security moved into CI/CD years ago. Reliability followed. Cost is next.

Putting savings insights where engineers already look is the shortest path from “we should optimize” to “we did optimize.”

The CloudExpat Cost Report action is available now on GitHub Marketplace.


Related Reading: