Automate GitHub Workflows with AI
AI-assisted GitHub workflow automation: PR review, issue triage, smart CI/CD, git operations, and @mention bot commands.
Why it matters
Streamline your development lifecycle by automating GitHub workflows. This asset leverages AI to enhance code reviews, triage issues, and integrate AI into your CI/CD pipelines.
Outcomes
What it gets done
Automate Pull Request reviews with AI-generated feedback.
Implement AI-driven issue triage and labeling.
Create and integrate AI into GitHub Actions for CI/CD.
Automate Git operations and smart test selection.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-github-workflow-automation | bash Overview
GitHub Workflow Automation
Patterns for adding AI assistance to GitHub workflows - automated PR review and issue triage, AI risk-gated CI/CD deploys with rollback, git rebase/cherry-pick/branch-cleanup automation, and an @mention bot for on-demand help, all built on GitHub Actions. Use when automating PR reviews, issue triage, AI-gated deployments, or git operations on GitHub; skip it for tasks outside GitHub workflow automation.
What it does
Provides patterns for automating GitHub workflows with AI assistance, inspired by Gemini CLI and modern DevOps practices - covering automated PR reviews, issue triage, AI-validated CI/CD, git operations like rebasing and cherry-picking, and an on-demand @mention bot.
When to use - and when NOT to
Use this skill when automating PR reviews with AI, setting up issue triage automation, creating GitHub Actions workflows, integrating AI into CI/CD pipelines, or automating git operations like rebases and cherry-picks.
Inputs and outputs
Automated PR review workflow triggers on pull_request open/synchronize, diffs the PR against the base branch, sends the diff to an AI model (example uses @anthropic-ai/sdk with claude-3-sonnet-20240229) for a structured review (summary, potential issues, suggestions, security concerns), and posts it as a PR comment via github.rest.pulls.createReview. Reviews can be filtered to specific file extensions and can include full file context, not just the diff.
Issue triage automation runs on issues: opened, sends the title/body to an AI classifier returning JSON (type, severity, area, summary, whether repro steps are present, suggested labels/assignees), applies labels accordingly, and posts a templated request for repro steps on under-specified bug reports. A companion stale-issue workflow (actions/stale@v9) closes inactive issues/PRs after configurable grace periods, exempting labels like pinned, security, and in-progress.
Smart CI/CD patterns include: path-based smart test selection (only run the api, frontend, or database suite based on which paths changed, defaulting to all if nothing specific matches); AI risk assessment before production deploys (returns riskLevel/concerns/recommendations/requiresManualApproval and fails the job via core.setFailed on high risk); and automated rollback via workflow_dispatch that finds the last stable git tag and redeploys it with a Slack notification.
Git operations covered: /rebase comment-triggered PR rebasing with git push --force-with-lease; AI-assisted cherry-picking that predicts conflicts before attempting them and can drive AI-assisted conflict resolution; and scheduled branch cleanup that finds branches untouched for 30+ days and opens a housekeeping issue listing them (with a /keep branch-name escape hatch).
The @ai-helper mention bot responds to PR/issue comments with context-aware answers, supporting commands like @ai-helper explain, review, fix, test, docs, plus /rebase, /update, /approve, /label bug, and /assign @user.
Repository configuration patterns include a CODEOWNERS file scoped by directory/team and branch protection rules configured via the GitHub API (required status checks, required approving reviews, code-owner review requirement, linear history, no force pushes).
Integrations
Built on GitHub Actions (actions/checkout, actions/github-script, actions/stale), the GitHub REST API, an Anthropic SDK client for AI calls, and Slack via slackapi/slack-github-action for notifications. References Google's Gemini CLI GitHub Action as inspiration.
Who it's for
DevOps engineers and maintainers who want to add AI assistance to their GitHub workflow - automated PR review and issue triage, AI-gated deployments, smart test selection, and an @mention bot for on-demand help - on top of standard GitHub Actions infrastructure.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.