Files
publish-to-gitea/SKILL.md
T

63 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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 <repo_name> "<description>" <files...>
```
脚本自动完成:
1. 🔍 隐私检查(检测 open_id、API key、token、IP 等敏感模式)
2. 📦 创建 Gitea **公开**仓库
3. 📄 收集文件(排除 .git、node_modules 等)
4. 🚀 Git init → commit → push
5. 🔗 返回仓库 URL
### 4. 反馈
推送成功后告诉用户仓库地址。
如果脚本检测到疑似隐私数据泄露,**必须停下来询问用户是否继续**——不可自动跳过。
## 安全约束
- ⚠️ 推送前必须过隐私检查
- 仓库默认**公开**(public),不设 private
- 不要推送 .git 目录、node_modules、二进制文件
- 如果之前泄露过隐私并已 amend,确认后再推
## 脚本依赖
`scripts/gitea_push.py` — Gitea 推送脚本,基于 tea CLI。