From ed7848e51432f64fa91263332472af84e03ded51 Mon Sep 17 00:00:00 2001 From: NightStar Date: Thu, 10 Sep 2026 16:51:26 +0800 Subject: [PATCH] [teamai] Push 1 resource(s) from root --- skills/publish-to-gitea/CONTRIBUTORS | 1 + skills/publish-to-gitea/SKILL.md | 62 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 skills/publish-to-gitea/CONTRIBUTORS create mode 100644 skills/publish-to-gitea/SKILL.md diff --git a/skills/publish-to-gitea/CONTRIBUTORS b/skills/publish-to-gitea/CONTRIBUTORS new file mode 100644 index 0000000..d8649da --- /dev/null +++ b/skills/publish-to-gitea/CONTRIBUTORS @@ -0,0 +1 @@ +root diff --git a/skills/publish-to-gitea/SKILL.md b/skills/publish-to-gitea/SKILL.md new file mode 100644 index 0000000..72a3182 --- /dev/null +++ b/skills/publish-to-gitea/SKILL.md @@ -0,0 +1,62 @@ +--- +name: "publish-to-gitea" +description: "将文件/目录发布到 Gitea 仓库 — 自动隐私检查、创建公开仓库、Git 推送" +--- + +# Publish to Gitea — 发布到 Gitea 仓库 + +将文件/目录推送到 Gitea 仓库(git.yoresee.cc),自动隐私检查、创建公开仓库、一键推送。 + +## 触发条件 + +用户说出类似以下话语时触发: +- "把这个推送到 gitea" +- "发布到仓库" +- "创建 repo 推上去" +- "publish to git" +- "推到 git.yoresee.cc" + +## 流程 + +### 1. 确定要推送的内容 + +从上下文中推断要推送的文件/目录。常见场景: +- 用户刚创建/修改了一个 skill → 推送整个 skill 目录 +- 用户说"把这个脚本推上去" → 推送脚本文件 +- 用户指定了具体路径 → 直接用 + +### 2. 确定仓库名和描述 + +- **仓库名**:从内容推断,kebab-case 格式 +- **描述**:一句话说明用途 +- 用户没明确说则主动确认 + +### 3. 执行推送 + +```bash +cd /root/.openclaw/workspace && python3 scripts/gitea_push.py "" +``` + +脚本自动完成: +1. 🔍 隐私检查(检测 open_id、API key、token、IP 等敏感模式) +2. 📦 创建 Gitea **公开**仓库(已存在则复用现有仓库) +3. 📄 收集文件(排除 .git、node_modules 等) +4. 🚀 Git 增量提交 → push(**已存在仓库先拉取远程历史,正常 commit + push,不使用 --force**;全新仓库直接首推) +5. 🔗 返回仓库 URL + +### 4. 反馈 + +推送成功后告诉用户仓库地址。 + +如果脚本检测到疑似隐私数据泄露,**必须停下来询问用户是否继续**——不可自动跳过。 + +## 安全约束 + +- ⚠️ 推送前必须过隐私检查 +- 仓库默认**公开**(public),不设 private +- 不要推送 .git 目录、node_modules、二进制文件 +- 如果之前泄露过隐私并已 amend,确认后再推 + +## 脚本依赖 + +`scripts/gitea_push.py` — Gitea 推送脚本,基于 tea CLI。