skill-github-daily-ops
Daily GitHub ops: health report per repo + safe auto-merge of Dependabot PRs (medium/low CVEs only).
Usage
CODEBLOCK0
Arguments
| Arg | Default | Description |
|---|
| INLINECODE0 | INLINECODE1 env | GitHub organization |
| INLINECODE2 |
all | Comma-separated repo names |
|
--report | false | Output markdown health report |
|
--merge-dependabot | false | Auto-merge safe Dependabot PRs |
Environment Variables
| Var | Description |
|---|
| INLINECODE5 | GitHub PAT (or reads from ~/.github_token) |
| INLINECODE7 |
Default org |
Auto-Merge Rules
- - ✅ Merges: Dependabot PRs where severity is LOW or MEDIUM and CI passes
- ⛔ Skips: HIGH or CRITICAL CVE PRs (require human review)
- ⏳ Skips: PRs with failing or in-progress CI
Report Output
Markdown table per repo with: open PRs, open issues, last commit date, Dependabot PR count.
Cron Example
CODEBLOCK1
skill-github-daily-ops
每日 GitHub 运维:每个仓库的健康报告 + Dependabot PR 的安全自动合并(仅限中/低危 CVE)。
使用方法
bash
生成所有组织仓库的健康报告
node scripts/daily-ops.js --org Zero2Ai-hub --report
自动合并安全的 Dependabot PR
node scripts/daily-ops.js --org Zero2Ai-hub --merge-dependabot
两者同时执行 — 指定仓库
node scripts/daily-ops.js --org Zero2Ai-hub --repos repo1,repo2 --report --merge-dependabot
参数
| 参数 | 默认值 | 描述 |
|---|
| --org | $GITHUB_ORG 环境变量 | GitHub 组织 |
| --repos |
全部 | 逗号分隔的仓库名称 |
| --report | false | 输出 Markdown 格式的健康报告 |
| --merge-dependabot | false | 自动合并安全的 Dependabot PR |
环境变量
| 变量 | 描述 |
|---|
| GITHUBTOKEN | GitHub PAT(或从 ~/.githubtoken 读取) |
| GITHUB_ORG |
默认组织 |
自动合并规则
- - ✅ 合并:严重级别为 LOW 或 MEDIUM 且 CI 通过的 Dependabot PR
- ⛔ 跳过:HIGH 或 CRITICAL CVE 的 PR(需要人工审核)
- ⏳ 跳过:CI 失败或进行中的 PR
报告输出
每个仓库的 Markdown 表格,包含:打开的 PR 数、打开的 Issue 数、最后提交日期、Dependabot PR 数量。
Cron 示例
bash
迪拜时间每天 08:00(UTC 时间 04:00)
0 4
* cd /path/to/workspace && node skills/skill-github-daily-ops/scripts/daily-ops.js --org Zero2Ai-hub --report --merge-dependabot >> /var/log/github-daily-ops.log 2>&1