From 21fb4736a23bbfffc268e6156e9a9bd8fb0425ef Mon Sep 17 00:00:00 2001 From: Satish Muddam Date: Tue, 30 Jun 2026 12:21:20 -0700 Subject: [PATCH] feat(ci): add AI Contribution Report workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ` - **Claude Code** → `Co-Authored-By: Claude ` - **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 --- .github/workflows/ai-contribution.yaml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ai-contribution.yaml diff --git a/.github/workflows/ai-contribution.yaml b/.github/workflows/ai-contribution.yaml new file mode 100644 index 0000000..cb03436 --- /dev/null +++ b/.github/workflows/ai-contribution.yaml @@ -0,0 +1,34 @@ +name: AI Contribution Report + +on: + push: + branches: + - main + +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Count AI-attributed commits + run: | + total=$(git log --oneline | wc -l | tr -d ' ') + cursor=$(git log --format="%B" | grep -i "co-author.*cursor" | wc -l | tr -d ' ') + claude=$(git log --format="%B" | grep -i "co-authored.*claude" | wc -l | tr -d ' ') + copilot=$(git log --format="%B" | grep -i "co-author.*copilot" | wc -l | tr -d ' ') + ai=$((cursor + claude + copilot)) + human=$((total - ai)) + + echo "## AI Contribution Report" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "| Tool | Commits | Share |" >> "$GITHUB_STEP_SUMMARY" + echo "|------|---------|-------|" >> "$GITHUB_STEP_SUMMARY" + echo "| Cursor | $cursor | $(( cursor * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY" + echo "| Claude | $claude | $(( claude * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY" + echo "| Copilot | $copilot | $(( copilot * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY" + echo "| **AI total** | **$ai** | **$(( ai * 100 / total ))%** |" >> "$GITHUB_STEP_SUMMARY" + echo "| Human | $human | $(( human * 100 / total ))% |" >> "$GITHUB_STEP_SUMMARY" + echo "| **Total** | **$total** | 100% |" >> "$GITHUB_STEP_SUMMARY"