github-ops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Operations
GitHub运营
Manage GitHub repositories with a focus on community health, CI reliability, and contributor experience.
专注于社区健康、CI可靠性和贡献者体验的GitHub仓库管理。
When to Activate
触发场景
- Triaging issues (classifying, labeling, responding, deduplicating)
- Managing PRs (review status, CI checks, stale PRs, merge readiness)
- Debugging CI/CD failures
- Preparing releases and changelogs
- Monitoring Dependabot and security alerts
- Managing contributor experience on open-source projects
- User says "check GitHub", "triage issues", "review PRs", "merge", "release", "CI is broken"
- 分类处理Issue(归类、打标签、回复、去重)
- 管理PR(审核状态、CI检查、过期PR、合并就绪状态)
- 排查CI/CD故障
- 准备版本发布和更新日志
- 监控Dependabot和安全告警
- 管理开源项目的贡献者体验
- 用户提到「查看GitHub」、「分类处理Issue」、「审核PR」、「合并」、「发布」、「CI挂了」等内容时
Tool Requirements
工具要求
- gh CLI for all GitHub API operations
- Repository access configured via
gh auth login
- 所有GitHub API操作都需要使用gh CLI
- 通过配置仓库访问权限
gh auth login
Issue Triage
Issue分类处理
Classify each issue by type and priority:
Types: bug, feature-request, question, documentation, enhancement, duplicate, invalid, good-first-issue
Priority: critical (breaking/security), high (significant impact), medium (nice to have), low (cosmetic)
按类型和优先级对每个Issue进行归类:
类型: bug、feature-request、question、documentation、enhancement、duplicate、invalid、good-first-issue
优先级: critical(中断性/安全问题)、high(影响重大)、medium(值得优化)、low(展示类问题)
Triage Workflow
分类处理工作流
- Read the issue title, body, and comments
- Check if it duplicates an existing issue (search by keywords)
- Apply appropriate labels via
gh issue edit --add-label - For questions: draft and post a helpful response
- For bugs needing more info: ask for reproduction steps
- For good first issues: add label
good-first-issue - For duplicates: comment with link to original, add label
duplicate
bash
undefined- 阅读Issue标题、正文和评论
- 检查是否重复现有Issue(按关键词搜索)
- 通过添加合适的标签
gh issue edit --add-label - 针对问题类Issue:草拟并发布有帮助的回复
- 针对需要更多信息的bug:请求提供复现步骤
- 针对入门友好的Issue:添加标签
good-first-issue - 针对重复Issue:评论附上原Issue链接,添加标签
duplicate
bash
undefinedSearch for potential duplicates
Search for potential duplicates
gh issue list --search "keyword" --state all --limit 20
gh issue list --search "keyword" --state all --limit 20
Add labels
Add labels
gh issue edit <number> --add-label "bug,high-priority"
gh issue edit <number> --add-label "bug,high-priority"
Comment on issue
Comment on issue
gh issue comment <number> --body "Thanks for reporting. Could you share reproduction steps?"
undefinedgh issue comment <number> --body "Thanks for reporting. Could you share reproduction steps?"
undefinedPR Management
PR管理
Review Checklist
审核检查清单
- Check CI status:
gh pr checks <number> - Check if mergeable:
gh pr view <number> --json mergeable - Check age and last activity
- Flag PRs >5 days with no review
- For community PRs: ensure they have tests and follow conventions
- 检查CI状态:
gh pr checks <number> - 检查是否可合并:
gh pr view <number> --json mergeable - 检查PR创建时长和最近活动时间
- 标记超过5天未审核的PR
- 针对社区贡献PR:确保包含测试且符合开发规范
Stale Policy
过期规则
- Issues with no activity in 14+ days: add label, comment asking for update
stale - PRs with no activity in 7+ days: comment asking if still active
- Auto-close stale issues after 30 days with no response (add label)
closed-stale
bash
undefined- 超过14天无活动的Issue:添加标签,评论请求更新
stale - 超过7天无活动的PR:评论询问是否仍在迭代
- 超过30天无回复的过期Issue自动关闭(添加标签)
closed-stale
bash
undefinedFind stale issues (no activity in 14+ days)
Find stale issues (no activity in 14+ days)
gh issue list --label "stale" --state open
gh issue list --label "stale" --state open
Find PRs with no recent activity
Find PRs with no recent activity
gh pr list --json number,title,updatedAt --jq '.[] | select(.updatedAt < "2026-03-01")'
undefinedgh pr list --json number,title,updatedAt --jq '.[] | select(.updatedAt < "2026-03-01")'
undefinedCI/CD Operations
CI/CD操作
When CI fails:
- Check the workflow run:
gh run view <run-id> --log-failed - Identify the failing step
- Check if it is a flaky test vs real failure
- For real failures: identify the root cause and suggest a fix
- For flaky tests: note the pattern for future investigation
bash
undefined当CI运行失败时:
- 查看工作流运行记录:
gh run view <run-id> --log-failed - 定位失败步骤
- 区分是不稳定测试还是真实故障
- 针对真实故障:定位根因并给出修复建议
- 针对不稳定测试:记录问题模式留待后续排查
bash
undefinedList recent failed runs
List recent failed runs
gh run list --status failure --limit 10
gh run list --status failure --limit 10
View failed run logs
View failed run logs
gh run view <run-id> --log-failed
gh run view <run-id> --log-failed
Re-run a failed workflow
Re-run a failed workflow
gh run rerun <run-id> --failed
undefinedgh run rerun <run-id> --failed
undefinedRelease Management
发布管理
When preparing a release:
- Check all CI is green on main
- Review unreleased changes:
gh pr list --state merged --base main - Generate changelog from PR titles
- Create release:
gh release create
bash
undefined准备版本发布时:
- 检查main分支所有CI运行正常
- 查看未发布的变更:
gh pr list --state merged --base main - 基于PR标题生成更新日志
- 创建版本发布:
gh release create
bash
undefinedList merged PRs since last release
List merged PRs since last release
gh pr list --state merged --base main --search "merged:>2026-03-01"
gh pr list --state merged --base main --search "merged:>2026-03-01"
Create a release
Create a release
gh release create v1.2.0 --title "v1.2.0" --generate-notes
gh release create v1.2.0 --title "v1.2.0" --generate-notes
Create a pre-release
Create a pre-release
gh release create v1.3.0-rc1 --prerelease --title "v1.3.0 Release Candidate 1"
undefinedgh release create v1.3.0-rc1 --prerelease --title "v1.3.0 Release Candidate 1"
undefinedSecurity Monitoring
安全监控
bash
undefinedbash
undefinedCheck Dependabot alerts
Check Dependabot alerts
gh api repos/{owner}/{repo}/dependabot/alerts --jq '.[].security_advisory.summary'
gh api repos/{owner}/{repo}/dependabot/alerts --jq '.[].security_advisory.summary'
Check secret scanning alerts
Check secret scanning alerts
gh api repos/{owner}/{repo}/secret-scanning/alerts --jq '.[].state'
gh api repos/{owner}/{repo}/secret-scanning/alerts --jq '.[].state'
Review and auto-merge safe dependency bumps
Review and auto-merge safe dependency bumps
gh pr list --label "dependencies" --json number,title
- Review and auto-merge safe dependency bumps
- Flag any critical/high severity alerts immediately
- Check for new Dependabot alerts weekly at minimumgh pr list --label "dependencies" --json number,title
- 审核并自动合入安全的依赖升级PR
- 立即标记所有严重/高优先级安全告警
- 至少每周检查一次新的Dependabot告警Quality Gate
质量门禁
Before completing any GitHub operations task:
- all issues triaged have appropriate labels
- no PRs older than 7 days without a review or comment
- CI failures have been investigated (not just re-run)
- releases include accurate changelogs
- security alerts are acknowledged and tracked
完成任何GitHub运营任务前需确认:
- 所有已处理的Issue都添加了合适的标签
- 没有超过7天未审核或未回复的PR
- CI故障已经过排查(而非仅重新运行)
- 版本发布包含准确的更新日志
- 安全告警已被确认并跟进