360 Secure SkillHub
360 安全技能中心

Repo Publisher

把私有 Git 仓库复制并清洗后推送到公开仓库:按 .publishignore 排除文件、按 .publishreplace 替换敏感字符串,并自动剥离密钥文件、环境文件、内网 IP 和常见 API key 模式;发布前支持 dry-run 预览,附带发布脚本与自动发布 hook,面向仓库开源发布场景。

h-mascot
h-mascot
热度 24.35
最近更新 2026-06-04 00:17:48
分类:开发依赖:代码执行 / 读写文件 / 第三方 API应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ec-repo-publisher
Metadata
name
repo-publisher
version
1.0.0
description
Sync private repos to clean public versions. Strips secrets, private IPs, API keys, and custom patterns before publishing.

Repo Publisher

Publish cleaned versions of private repos for public sharing.

How It Works

  1. Private repo (henrino3/project) - your full backup with secrets, configs, everything
  2. Public repo (henrino3/project-public) - cleaned version safe to share
  3. publish.sh copies private → strips secrets → pushes to public

Usage

# Dry run first (shows what would be removed/replaced)
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink.git \
  --dry-run

# Actually publish
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink.git

Configuration Files

.publishignore

Place in your repo root. Lists files/dirs to exclude from public version (like .gitignore).

# Private configs
secrets/
private/
.env.local
my-private-notes.md
internal-docs/

# Agent-specific data
crewlink-api-keys.json
agent-tokens/

.publishreplace

Place in your repo root. Lists find|replace pairs for scrubbing private values.

# Format: FIND_STRING|REPLACE_STRING
henry@curacel.ai|you@example.com
Enterprise Crew|Your Crew Name
ada-gateway|your-server
henrymascot|your-username

What Gets Stripped Automatically

Even without config files, the script always strips:

  • secrets/ directories
  • *.key, *.pem, *.p12 files
  • .env and *.env files
  • *.log files
  • node_modules/
  • Tailscale IPs (100.x.x.x → YOUR_SERVER_IP)
  • Local IPs (192.168.x.x → YOUR_LOCAL_IP)
  • Common API key patterns (sk-, gho_, crewlink_, moltbook_)
  • Bearer tokens

Workflow for Ada

When Henry says "publish X" or "share X publicly":

  1. Check if public repo exists: gh repo view henrino3/X-public
  2. If not, create it: gh repo create henrino3/X-public --public
  3. Run dry-run first to review
  4. Run publish
  5. Share the public URL with Henry

Example: Publishing CrewLink

# Make crewlink repo private first
gh repo edit henrino3/crewlink --visibility private

# Create public version
gh repo create henrino3/crewlink-public --public --description "Agent social network for your AI crew"

# Publish clean version
~/clawd/skills/repo-publisher/scripts/publish.sh \
  ~/Code/crewlink \
  git@github.com:henrino3/crewlink-public.git

Secret Scanning

After stripping, the script scans for leaked secrets and warns if any are found. Always run --dry-run first on a new repo to review what gets cleaned.