Skip to main content
GitHub bills Actions minutes, Packages storage, Copilot seats and more against one organization, so a single connection captures the lot. It also reads every GitHub Actions job, on every runner. CostGraph also reads Actions artifact and cache storage, which powers storage retention insights. CostGraph reads GitHub billing as FOCUS 1.2 records at a grain of day x product x SKU x repository, carrying both gross and net billed cost.

Choose how the data reaches us

CostGraph pulls it

You install the CostGraph GitHub App and we call GitHub once a day. Nothing to run.

You push it

You send us FOCUS records over the API. Credentials never leave your infrastructure.

Connect with the GitHub App

  1. Open Settings > Integrations and pick GitHub.
  2. Name the connection, pick the tenant these charges belong to, and enter the organization login whose billing you want.
  3. Pick an installation of the CostGraph GitHub App for your organization, or select Install the GitHub App to install it from the form. GitHub returns you to Integrations afterwards.
  4. Select Connect.
The app asks for read-only access. Organization Administration covers billing usage, Copilot premium requests, and Actions cache usage. Organization GitHub Copilot seat management covers seats, and Plan covers plan details. Repository Actions covers artifacts and every Actions job, and repository Administration covers artifact retention settings. Repository Pull requests links each job to its pull request. Metadata is also read. It can’t change anything in your organization. If you installed the app before these permissions were added, an owner of the GitHub organization must approve the updated permissions in GitHub. Until then, connecting shows “Approve the updated CostGraph GitHub App permissions in GitHub.”

Runners detected from GitHub

Connecting GitHub also reads every Actions job, by repository, workflow, and runner size. CostGraph recognizes the runner vendor and shows each job’s cost under the vendor it ran on. Cost for managed vendors is estimated from the vendor’s list price. Connect Blacksmith or Depot as well to add the minutes and cost on their own bill.

Push it yourself

Send the charges to CostGraph as FOCUS records instead. Push FOCUS data covers the connection id, the focus:write key, and the request shape.

Run the exporter

Rather than build that request yourself, run our exporter. It reads GitHub on a schedule and pushes the records for you, wherever you want to run it: a container, a Kubernetes CronJob, or a binary on a machine you already have.
The second command pushes Actions jobs; CostGraph runs it for you when you connect GitHub. Your GitHub credential stays where you put it, and only the finished FOCUS records reach CostGraph. Run the exporter covers the three ways to run it and the variables it reads.

What CostGraph does with it

Records land as raw billing rows, are normalised into line items, and roll up into daily cost. From there GitHub spend appears in Cost Overview and in anomaly detection alongside every other provider.

Show CI cost on pull requests

The CostGraph CI cost action keeps one comment on each pull request with what its CI runs have cost so far. The comment shows the total since the pull request was opened, the cost of each workflow, and the cost of failed jobs, cancelled jobs and re-runs. Before you begin:
  • Connect GitHub on this page.
  • Create an API key with the focus:read scope in Settings > Account > API keys, and store it as the secret COSTGRAPH_API_KEY.
Add a final job that waits for your other jobs, so the comment updates after each push, even when a job fails:
The test job can use any runner. Pull requests from forks get no secrets, so the if: skips them. The comment is separate from the Terraform cost comment, and both update in place. Jobs arrive within about 6 hours, so the comment trails the runs. The run that posts it, and recent runs, may not be counted yet. Until any usage arrives, the comment says that no CI cost is recorded yet. Outside GitHub Actions, install the CostGraph CLI and run costgraph cost ci comment github --repo owner/name --pull-request 12. Add --dry-run to print the comment instead of posting it.