← All IntegrationsIntegration
Analytics for GitHub Actions
Shift analytics left into your CI/CD pipeline. The BetterMeter CLI runs inside GitHub Actions to post traffic impact summaries on pull requests, generate weekly reports, and track CI pipeline usage — all automated, no dashboard required.
Post traffic impact on pull requests
After each production deploy, this workflow compares the last 24 hours of traffic to the previous period and comments on the merged PR with the delta. Your team sees the real-world impact of every change without leaving GitHub.
.github/workflows/traffic-report.yml
name: Traffic Impact Report
on:
deployment_status:
jobs:
report:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install BetterMeter CLI
run: npm install -g @bettermeter/cli
- name: Generate traffic report
env:
BETTERMETER_API_KEY: ${{ secrets.BETTERMETER_API_KEY }}
BETTERMETER_SITE: ${{ secrets.BETTERMETER_SITE }}
run: |
bettermeter stats --period 24h --compare previous --format markdown > report.md
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const body = fs.readFileSync('report.md', 'utf8');
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha,
});
if (prs.length > 0) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prs[0].number,
body: '## 📊 Traffic Impact Report\n\n' + body,
});
}CI pipeline analytics
Track how often your CLI tools are invoked inside CI environments. The @bettermeter/node SDK detects GitHub Actions automatically via the CI and GITHUB_ACTIONS environment variables and tags events accordingly.
- 01Automated reporting — Schedule weekly traffic summaries via cron-triggered workflows.
- 02Deploy correlation — Compare traffic before and after each deploy automatically.
- 03CLI usage in CI — Track which CLI commands your pipelines invoke and how often.
- 04MCP tool tracking — If your CI runs MCP servers, BetterMeter captures tool invocations too.
PR Comments
Traffic impact per deploy
Cron Reports
Scheduled summaries
CI Detection
Auto-tags CI events