github-workflow-automation
/github-workflow-automation
Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI/CD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating CI/CD pipelines, or integrating AI into DevOps.
- Author
- bcastelino ↗
- Repository
- agent-skills-kit ↗
- Licence
- MIT
- Last repository change
- 05.08.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 5
No signals detected. Repository changed on 05.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI/CD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating CI/CD pipelines, or integrating AI into DevOps.
Original author description
Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI/CD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating CI/CD pipelines, or integrating AI into DevOps.
How it works
- When to Use This Skill
- 1. Automated PR Review
- 2. Issue Triage Automation
- 3. CI/CD Integration
- 4. Git Operations
- 5. On-Demand Assistance
- 6. Repository Configuration
- Best Practices
- Resources
SKILL.md preview
---
name: github-workflow-automation
description: "Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI/CD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating CI/CD pipelines, or integrating AI into DevOps."
---
# GitHub Workflow Automation
> Patterns for automating GitHub workflows with AI assistance, inspired by [Gemini CLI](https://github.com/google-gemini/gemini-cli) and modern DevOps practices.
## When to Use This Skill
- Automating PR reviews with AI
- Setting up issue triage automation
- Creating GitHub Actions workflows
- Integrating AI into CI/CD pipelines
- Automating Git operations (rebases, cherry-picks)
> Full YAML workflow files are in [references/workflow_examples.md](references/workflow_examples.md).
---
## 1. Automated PR Review
Create `.github/workflows/ai-review.yml` triggered on `pull_request: [opened, synchronize]`.
**Flow:** checkout with `fetch-depth: 0` → collect changed files and diff via `git diff` → send to an LLM (e.g., Claude) → post the response as a PR review comment.
Key elements:
- Permissions: `pull-requests: write`, `contents: read`
- Use `actions/github-script@v7` to call the AI API and `pulls.createReview`
- Store the API key in `secrets.ANTHROPIC_API_KEY`
Review output should follow this structure: **Summary → What looks good → Potential Issues → Suggestions → Security Notes**.
For focused reviews, filter changed files with `grep -E '\.(ts|tsx|js|jsx|py|go)$'` before sending to the model.
---
## 2. Issue Triage Automation
### Auto-label on Open
Create `.github/workflows/issue-triage.yml` triggered on `issues: [opened]`.
**Flow:** read issue title & body → call AI with a classification prompt → apply labels (`bug`, `enhancement`, `question`, area labels) → if bug with no repro steps, post a comment asking for details.
**Triage prompt returns JSON:**
```json
{
"type": "bug | feature | question | docs | other",
"severity": "low | medium | high | critical",
"area": "frontend | backend | api | docs | ci | other",
"summary": "one-line summary",
"hasReproSteps": true,
"suggestedLabels": [],
"suggestedAssignees": []
}
```
### Stale Issue Management
Use `actions/stale@v9` on a daily cron. Mark issues stale after 60 days, close after 14 more. Exempt labels: `pinned`, `security`, `in-progress`.
---
## 3. CI/CD Integration
### Smart Test Selection
Trigger on `pull_request`. Determine which test suites to run by inspecting changed paths:
| Changed path prefix | Suites to run |
|:---------------------|:--------------|
| `src/api/` | `api` |
| `src/frontend/` | `frontend` |
| `src/database/` | `database`, `api` |
| *(none matched)* | `all` |
Use a matrix strategy with `fromJson()` to fan out the test jobs.
### Deploy with AI Risk Assessment
On push to `main`, gather commits since last tag, send to AI for risk analysis (`low / medium / high`). Fail the pipeline when risk is `high` to force manual review. Follow with a deployment job gated by the `production` environment.
### Rollback Automation
Create a `workflow_dispatch` workflow that accepts a `reason` input. Find the latest stable tag with `git tag -l 'v*' --sort=-version:refname | head -1`, deploy it, and notify the team via Slack.
---
## 4. Git Operations
### Automated Rebasing
Listen for `/rebase` in PR comments via `issue_comment: [created]`. Checkout the PR, `git rebase origin/main`, and `git push --force-with-lease`. Comment the result.
### Smart Cherry-Pick
AI-assisted cherry-pick flow:
1. Get commit info and diff against target branch.
2. Ask AI whether conflicts are likely and suggest a resolution strategy.
3. If conflicts expected, create a feature branch, cherry-pick, then resolve each conflict file with AI guidance.
4. Otherwise, cherry-pick directly.
### Branch Cleanup
Weekly cron workflow that lists branches not updated in 30+ days (excluding `main`/`develop`). Creates a housekeeping issue listing stale branches for team review.
---
## 5. On-Demand Assistance
### @mention Bot
Listen for `@ai-helper` in issue/PR comments. Extract the question text, gather context (PR diff or issue body via `gh` CLI), send both to the AI, and post the response as a comment.
### Available Commands
| Command | Description |
|:--------|:------------|
| `@ai-helper explain` | Explain the code in this PR |
| `@ai-helper review` | Request AI code review |
| `@ai-helper fix` | Suggest fixes for issues |
| `@ai-helper test` | Generate test cases |
| `@ai-helper docs` | Generate documentation |
| `/rebase` | Rebase PR onto main |
| `/update` | Update PR branch from main |
| `/label <name>` | Add a label |
| `/assign @user` | Assign to user |
---
## 6. Repository Configuration
### CODEOWNERS
Map directories and file globs to teams in `.github/CODEOWNERS`:
```
* @org/core-team
/src/frontend/ @org/frontend-team
/src/api/ @org/backend-team
/.github/ @org/devops-team
/src/auth/ @org/security-team
```
### Branch Protection
Use `repos.updateBranchProtection` via `actions/github-script` to enforce:
- Required status checks (`test`, `lint`, `ai-review`) with strict mode
- At least 1 approving review from code owners; dismiss stale reviews
- Linear history required; no force pushes or deletions
---
## Best Practices
### Security
- Store API keys in GitHub Secrets
- Use minimal permissions in workflows
- Validate all inputs; don't expose sensitive data in logs
### Performance
- Cache dependencies; use matrix builds for parallel testing
- Skip unnecessary jobs with path filters
- Use self-hosted runners for heavy workloads
### Reliability
- Add timeouts to all jobs
- Handle rate limits gracefully with retry logic
- Always have rollback procedures
---
## Resources
- [Gemini CLI GitHub Action](https://github.com/google-github-actions/run-gemini-cli)
- [GitHub Actions Documentation](https://docs.github.com/en/actions)
- [GitHub REST API](https://docs.github.com/en/rest)
- [CODEOWNERS Syntax](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)
Files in this package (2)
- SKILL.md 6 KB
- references/workflow_examples.md 16 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · bcastelino/agent-skills-kit | 100 | MIT |
| dreamlab-ai/agentbox | 100 | AGPL-3.0 |
| davila7/claude-code-templates | 95 | MIT |
Database snapshot: 13.11.2026 · package version bd9be8d1d8f1 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90github-automation
Automate GitHub repositories, issues, pull requests, branches, CI/CD, and permissions via MCP. Use when managing code workflows or automating GitHub operations programmatically. - 100workflow-automation
Automate repetitive development tasks and workflows. Use when creating build scripts, automating deployments, or setting up development workflows. Handles npm scripts, Makefile, GitHub Actions workflows, and task automation. - 100claude-code-github-workflows
Claude Code GitHub Actions workflow patterns — PR reviews, issue triage, CI/CD integration. Use when creating or modifying workflows that integrate Claude Code. - 100github-actions
GitHub Actions CI/CD. Covers workflows, jobs, and deployment. Use for automating builds, tests, and deployments. USE WHEN: user mentions "github actions", "workflow", "ci/cd", ".github/workflows", "actions/checkout", "github workflow", asks about "automate tests", "deploy on… - 89devops-tooling
Git operations, shell scripting, CI/CD pipelines, and terminal automation. Use for conventional commits, PowerShell/Bash scripting, configuring GitHub Actions, or automating development tooling workflows. - 100bootstrap-issue-config
Bootstrap the issue triage configuration for a repository by analyzing existing issues, labels, and contributors to generate `.github/issue-triage/config.json` and `.github/STAKEHOLDERS`. Use when setting up triage automation on a new or existing repository for the first time.