Skip to content

AI GitHub Actions Banner

AI GitHub Actions

Drop-in AI agents for GitHub repos. They triage issues, review PRs, diagnose CI failures, and continuously improve your codebase — all through standard GitHub Actions. Get started with our 5 core workflows with more than 40 additional workflows available to use as needed.


Get Started in 60 Seconds

The agents use GitHub Copilot as their AI engine. You create a personal access token (PAT) so the workflows can authenticate.

1. Create a Copilot PAT — this link pre-fills the name, description, and scope:

Create COPILOT_GITHUB_TOKEN →

Set the expiry to longer than the 30-day default (e.g., 90 days or 1 year).

2. Store the secret and install the core workflowscd into the repo you want to configure and run:

printf '%s' 'YOUR_PAT_HERE' | gh secret set COPILOT_GITHUB_TOKEN

mkdir -p .github/workflows && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/issue-triage/example.yml \
  -o .github/workflows/trigger-issue-triage.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/mention-in-issue/example.yml \
  -o .github/workflows/trigger-mention-in-issue.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/mention-in-pr/example.yml \
  -o .github/workflows/trigger-mention-in-pr.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/pr-review/example.yml \
  -o .github/workflows/trigger-pr-review.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/pr-actions-detective/example.yml \
  -o .github/workflows/trigger-pr-actions-detective.yml

3. Commit and push. That's it — you now have five agents working for you:

  • New issues are automatically triaged, labeled, and given an implementation plan.
  • Pull requests get AI code reviews with severity-ranked inline comments.
  • Failed CI checks are diagnosed with root-cause analysis and fix suggestions.
  • Type /ai in any issue or PR to ask for help, get code written, or push fixes.

See the full setup docs for secrets, inputs, and customization options.


Core Workflows

These five workflows ship with the install command above:

Workflow Trigger What it does
Issue Triage New issues Investigate, label, and provide implementation plans
Mention in Issue /ai in issues Answer questions, debug, create PRs
Mention in PR /ai in PRs Review, fix code, push changes
PR Review PR opened / updated AI code review with severity-ranked inline comments
PR Actions Detective Failed PR checks Diagnose CI failures and recommend fixes

Repository Maintenance

Add-on workflows that keep your issues and PRs clean:

Workflow What it does
Duplicate Issue Detector Flag duplicate issues with links to originals
Stale Issues Find resolved issues and manage their lifecycle
Update PR Body Auto-populate PR descriptions from diffs and linked issues
Install these workflows

cd into your repo and run:

mkdir -p .github/workflows && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/duplicate-issue-detector/example.yml \
  -o .github/workflows/trigger-duplicate-issue-detector.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/stale-issues-investigator/example.yml \
  -o .github/workflows/trigger-stale-issues-investigator.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/update-pr-body/example.yml \
  -o .github/workflows/trigger-update-pr-body.yml

Codebase Maintenance

Scheduled agents that continuously find and fix problems:

Workflow What it does
Bug Hunting Find reproducible bugs and open PRs to fix them
Code Duplication Detect duplicate code and consolidate it
Test Coverage Find coverage gaps and add targeted tests
Code Simplifier Simplify overcomplicated code with high-confidence refactors
Docs Patrol Catch stale documentation and flag it
Install these workflows

cd into your repo and run:

mkdir -p .github/workflows && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/bug-hunter/example.yml \
  -o .github/workflows/trigger-bug-hunter.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/code-duplication-detector/example.yml \
  -o .github/workflows/trigger-code-duplication-detector.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/test-coverage-detector/example.yml \
  -o .github/workflows/trigger-test-coverage-detector.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/code-simplifier/example.yml \
  -o .github/workflows/trigger-code-simplifier.yml && \
curl -fsSL https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/docs-patrol/example.yml \
  -o .github/workflows/trigger-docs-patrol.yml

Browse all 40+ workflows →


Meet the Crew

  • The Reviewers


    PR Review, Mention in PR, Update PR Body. File-by-file severity-ranked code reviews on every pull request — and they fix what they find.

  • The Detectives


    PR Actions Detective, Branch Actions Detective. CI is red and the logs are noise. The Detectives find the line that matters.

  • The Quality Crew


    Bug Hunter, Flaky Test Investigator, Code Duplication Detector. From finding bugs to preventing them — the full quality spectrum.

  • The Idea Machines


    Product Manager Impersonator, configured with different personas. Daily feature proposals from an iterative thinker, an SRE, a security analyst, and more.

  • The Issue Squad


    Issue Triage, Duplicate Detector, Deep Research. New issues are labeled, prioritized, and deduplicated within seconds.

  • The Watchdogs


    Breaking Change Detector, Performance Profiler, UX Design Patrol, Information Architecture. They guard the things developers forget to check.

Browse all blog posts