Skip to content

Conversation

@pierresisson
Copy link
Member

@pierresisson pierresisson commented Jan 5, 2026

What does it do? Why?

This feature automatically detects AI-assisted pull requests and applies the genai-assisted label. The GitHub Action is the single source of truth for adding the label.

Unified Hook System

Claude Code and Cursor use the same mechanism to signal AI assistance, with agent-specific markers:

Agent (Claude Code or Cursor) stops
         ↓
Hook "stop" creates marker file (.claude-assisted or .cursor-assisted)
         ↓
User commits (from any terminal, IDE, etc.)
         ↓
Git hook "prepare-commit-msg" detects marker
         ↓
Adds "Co-Authored-By: Claude" or "Co-Authored-By: Cursor" + removes marker
         ↓
GitHub Action detects Co-Authored-By → Adds label

Files involved

File Purpose
.githooks/prepare-commit-msg Adds Co-Authored-By based on marker file
.cursor/hooks.json Cursor hook: creates .cursor-assisted when agent stops
.claude/settings.json Claude Code hook: creates .claude-assisted when agent stops
.cursor-assisted / .claude-assisted Temporary marker files (gitignored)

Co-Authored-By tags

Agent Marker file Co-Authored-By
Cursor .cursor-assisted Co-Authored-By: Cursor
Claude Code .claude-assisted Co-Authored-By: Claude

Why this approach?

  • Single source of truth: Only the GHA adds the label (no duplicate logic)
  • Works with external terminals: The marker file persists until commit
  • Agent-specific tags: Each agent gets its own Co-Authored-By signature
  • No false positives: Co-Authored-By only added when an agent actually worked

Detection Flags Summary (GitHub Action)

Flag Source Examples
Bot Author PR author copilot[bot], claude[bot], cursor[bot], codeium[bot], tabnine[bot], cody[bot], devin[bot], aider[bot]
Branch Prefix Branch name cursor/, claude/, ai/, copilot/, aider/, cody/, chatgpt/, genai/, windsurf/, devin/
PR Body Pattern PR description AI-assisted, generated with Claude, using Copilot, LLM-assisted
AI Label Existing labels ai-assisted, copilot, claude, chatgpt, cursor, genai, llm-assisted
Commit Signature Commit message Co-Authored-By: Claude, Co-Authored-By: Cursor, Generated with [Claude Code], [Copilot], [AI]
Commit Emoji Commit message Contains 🤖 emoji
Rapid Commits Commit timing 3+ commits within 30 seconds
Comment Pattern PR comments I used Claude, Copilot generated this, AI wrote this

See README.md for more information.

Co-authored-by: Claude

Copilot AI review requested due to automatic review settings January 5, 2026 22:14
@github-actions github-actions bot added the feat New Feature label Jan 5, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automatic detection and labeling of GenAI-assisted pull requests to the existing validation action. The feature scans PRs for indicators of AI tool usage (like Claude, Copilot, ChatGPT, etc.) and applies a genai-assisted label when detected.

  • Implements comprehensive pattern matching for 70+ AI coding tools and assistants
  • Detects AI assistance through multiple signals: PR author, body, labels, commits, and comments
  • Integrates detection into the existing PR validation workflow with graceful error handling

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
lib/genaiPatterns.js Defines exhaustive patterns for detecting AI tools, bots, commit signatures, and labels
lib/genaiDetection.js Core detection logic that checks PRs across multiple dimensions (author, body, commits, comments)
lib/genaiDetection.test.js Unit tests covering pattern matching for bots, labels, commits, PR bodies, and comments
lib/actions/pullRequest.js Integrates GenAI detection into PR validation workflow with error handling
README.md Documents the GenAI detection feature, triggers, supported tools, and customization options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-authored-by: Claude
Co-Authored-By: GenAI
Co-Authored-By: Cursor
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 7 comments.

Comments suppressed due to low confidence (2)

README.md:3

  • This line appears to be a debug note that should be removed before merging. It doesn't provide value in the README and looks unprofessional.
[![NPM](https://github.com/mobsuccess-devops/github-actions-mobsuccess/actions/workflows/npm.yml/badge.svg)](https://github.com/mobsuccess-devops/github-actions-mobsuccess/actions/workflows/npm.yml)

README.md:1

  • The company name "GitHub" should be capitalized correctly as "GitHub" not "Github".
# Github Mobsuccess action

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude
Co-Authored-By: Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants