Skip to content

Commit 21fb473

Browse files
satish-mclaude
andcommitted
feat(ci): add AI Contribution Report workflow
Adds a GitHub Actions workflow that automatically measures AI tool involvement across the repository's full commit history on every merge to main. ## What it does - Triggers on every push to `main` - Scans all commit messages for `Co-Authored-By:` trailers stamped by AI coding tools (Cursor, Claude Code, GitHub Copilot) - Counts commits attributed to each tool vs. purely human-authored - Renders a markdown summary table directly in the GitHub Actions job summary (visible in the Actions tab after each merge) ## Signal measured The `Co-Authored-By:` trailer is written automatically by: - **Cursor** → `Co-authored-by: Cursor <cursoragent@cursor.com>` - **Claude Code** → `Co-Authored-By: Claude <noreply@anthropic.com>` - **GitHub Copilot** → `Co-authored-by: GitHub Copilot <...>` Commits without any such trailer are counted as human-only. Note that commits may still have had AI assistance without a trailer (e.g. code pasted from a chat interface), so this is a lower-bound estimate. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0a053b0 commit 21fb473

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: AI Contribution Report
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
report:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Count AI-attributed commits
17+
run: |
18+
total=$(git log --oneline | wc -l | tr -d ' ')
19+
cursor=$(git log --format="%B" | grep -i "co-author.*cursor" | wc -l | tr -d ' ')
20+
claude=$(git log --format="%B" | grep -i "co-authored.*claude" | wc -l | tr -d ' ')
21+
copilot=$(git log --format="%B" | grep -i "co-author.*copilot" | wc -l | tr -d ' ')
22+
ai=$((cursor + claude + copilot))
23+
human=$((total - ai))
24+
25+
echo "## AI Contribution Report" >> "$GITHUB_STEP_SUMMARY"
26+
echo "" >> "$GITHUB_STEP_SUMMARY"
27+
echo "| Tool | Commits | Share |" >> "$GITHUB_STEP_SUMMARY"
28+
echo "|------|---------|-------|" >> "$GITHUB_STEP_SUMMARY"
29+
echo "| Cursor | $cursor | $(( cursor * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY"
30+
echo "| Claude | $claude | $(( claude * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY"
31+
echo "| Copilot | $copilot | $(( copilot * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY"
32+
echo "| **AI total** | **$ai** | **$(( ai * 100 / total ))%** |" >> "$GITHUB_STEP_SUMMARY"
33+
echo "| Human | $human | $(( human * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY"
34+
echo "| **Total** | **$total** | 100% |" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)