Git Integration
Connect a GitHub or GitLab repository so cost alerts land as issues where your team already tracks infrastructure work.
CostLens can deliver cost alerts — new high-priority recommendations, budget breaches, and other notifications — directly into a GitHub or GitLab repository as an issue, alongside your existing Slack and Teams channels. This brings cost findings into the same place your team already tracks infrastructure and ops work, instead of requiring anyone to check a separate dashboard.
How it helps
Most cost problems eventually become engineering work — resizing an instance, deleting a stale volume, or replacing a hardcoded setting. Routing those findings straight into your repository as issues means:
- Cost alerts show up where the team already triages work, with no extra tool to check.
- A recommendation can be referenced, assigned, and closed using your existing repo workflow.
- Nothing is silently missed because it only appeared in an email or a dashboard nobody opened that day.
Also powers Infrastructure-as-Code fixes
This is the same connection CostLens uses to open pull requests that apply cost-saving fixes directly to your Terraform code, so your infrastructure state and source stay in sync — see Infrastructure-as-Code Fixes. If you plan to use that feature, grant Pull requests write on GitHub (in addition to Contents) when you connect below, so both capabilities work from one connection.
Connecting a repository
- Go to Settings → Integrations.
- Find the GitHub or GitLab card and click Connect.
- Enter the repository:
- GitHub —
owner/repo(no nested groups). - GitLab —
group/subgroup/project(nested groups are fine). If you're on a self-hosted GitLab instance, add its base URL.
- GitHub —
- Provide an access token:
- GitHub — a fine-grained personal access token scoped to that repository, with Contents and Issues write access (add Pull requests write too if you plan to use Infrastructure-as-Code Fixes).
- GitLab — a personal or project access token with the
apiscope.
- Click Connect.
Admin only
Only an organization admin can connect, edit, or remove a Git integration.
Your token is encrypted at rest and is never displayed again after saving — to change it later, edit the connection and enter a new one.
Bitbucket
A Bitbucket card is visible in Settings but shows a Coming soon badge — the connection form saves your details, but delivery isn't wired up yet. GitHub and GitLab are fully functional today.
Testing the connection
Once connected, click Test on the integration card. This performs a read-only permission check against your repository — it confirms CostLens can reach it and has the access it needs, without creating a real issue. A successful test shows Last verified with a timestamp; a failed test explains what's wrong (for example, a token that can read but not write).
Managing an existing connection
From the same card you can:
- Edit — update the repository path or rotate the access token.
- Test — re-verify the connection at any time.
- Disconnect — remove the integration. You can reconnect later without losing any history.
If CostLens can no longer deliver to a connected repository (for example, a revoked token), the connection is automatically paused and marked Reconnect required so it doesn't keep failing silently — update the token to resume delivery.
What gets delivered
A connected repository receives the same categories of alert already configured for your other notification channels — for example, new critical or high-severity recommendations. Each delivery opens as a new issue (or, where configured, a comment on an existing tracking issue) with the finding, its estimated savings, and a link back to the recommendation in CostLens.