openclaw-gitcode-pr-monitor
This skill packages a production-ready GitCode PR monitoring + auto-review pipeline.
What it does
- - Poll GitCode PR list for one or more repos (defaults use anonymous placeholders:
ExampleOrg/example_repo_1 + ExampleOrg/example_repo_2) - When a new PR is detected:
- send “review started” notification
- run
openclaw agent to generate a Markdown review report
- post the report back to the PR as a comment
- send “review finished” notification + attach the report
Files
- -
scripts/monitor-gitcode-pr.sh — fetch latest PR, compare state, output INLINECODE4 - INLINECODE5 — orchestrator (multi-repo loop)
- INLINECODE6 — run AI review (repo-aware, daily rotated session id)
- INLINECODE7 — post PR comment (repo-aware)
Quick start
1) Put your GitCode token at:
2) Configure notification targets
This packaged version defaults to DingTalk + WeCom, but you must set your own targets.
Recommended (env vars):
CODEBLOCK0
3) Configure repos
Recommended (env vars):
CODEBLOCK1
4) Install cron
Example (every 5 minutes):
CODEBLOCK2
See: references/CONFIG.md.
openclaw-gitcode-pr-monitor
该技能封装了一个生产就绪的GitCode PR监控与自动审查流水线。
功能说明
- - 轮询一个或多个仓库的GitCode PR列表(默认使用匿名占位符:ExampleOrg/examplerepo1 + ExampleOrg/examplerepo2)
- 检测到新PR时:
- 发送“审查已开始”通知
- 运行openclaw agent生成Markdown格式的审查报告
- 将报告作为评论发布回PR
- 发送“审查已完成”通知并附带报告
文件结构
- - scripts/monitor-gitcode-pr.sh — 获取最新PR,比较状态,输出NEWPRDETECTED
- scripts/gitcode-pr-monitor-agent.sh — 编排器(多仓库循环)
- scripts/code-review-robust.sh — 运行AI审查(感知仓库,每日轮换会话ID)
- scripts/submit-pr-comment.sh — 发布PR评论(感知仓库)
快速开始
1) 将GitCode令牌放入:
- - $HOME/.openclaw/workspace/data/gitcode-token.txt
2) 配置通知目标
本打包版本默认支持钉钉+企业微信,但必须设置自己的目标。
推荐(环境变量):
bash
export TARGET_DINGTALK=<你的钉钉目标>
export TARGET_WECOM=user:<企业微信用户ID>
3) 配置仓库
推荐(环境变量):
bash
export REPO_OWNER=<你的组织>
export REPOSCSV=repoa,repo_b
4) 安装定时任务
示例(每5分钟执行):
cron
/5 * OPENCLAWWORKSPACE=$HOME/.openclaw/workspace REPOOWNER=... REPOSCSV=... TARGETDINGTALK=... TARGETWECOM=... $OPENCLAWWORKSPACE/skills/openclaw-gitcode-pr-monitor/scripts/gitcode-pr-monitor-agent.sh >> $OPENCLAW_WORKSPACE/logs/cron-gitcode-pr.log 2>&1
参见:references/CONFIG.md。