{"id":"2e9de86f-f786-41c6-ac9c-e9e0c822abb5","entityType":"agent","slug":"clawhub-gypalyson-creator-github-pages-publish","name":"github-pages-publish","canonicalUrl":"https://www.xpersona.co/agent/clawhub-gypalyson-creator-github-pages-publish","canonicalPath":"/agent/clawhub-gypalyson-creator-github-pages-publish","generatedAt":"2026-10-10T14:44:49.048Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":null},"description":"把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。 Skill: github-pages-publish Owner: gypalyson-creator Summary: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。 Tags: latest:0.1.0 Version history: v0.1.0 | 2026-08-17T13:18:09.248Z | auto","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17frxc1gxs124qk1qxe2v30ph884mbj:github-pages-publish","sourceUrl":"https://clawhub.ai/gypalyson-creator/github-pages-publish","homepage":"https://clawhub.ai/gypalyson-creator/skills/github-pages-publish","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/gypalyson-creator/github-pages-publish","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/gypalyson-creator/skills/github-pages-publish","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":63,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":null},"stars":null,"forks":null,"downloads":1433,"packageName":null,"latestVersion":"0.1.0","tractionLabel":"1.4K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T12:26:03.199Z","lastCrawledAt":"2026-10-10T12:26:03.199Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T12:26:03.199Z","lastVerifiedAt":null,"highlights":[{"version":"0.1.0","createdAt":"2026-08-17T13:18:09.248Z","changelog":"Initial release of github-pages-publish. - Publish existing static website files (HTML or site directory) safely to GitHub Pages and generate a public URL. - Supports incremental uploads: never overwrites or force-pushes existing remote files. - Provides deploy.py script with three modes: whole site upload, single file upload, or Pages enable-only. - Pure Python, standard library only, no extra dependencies. - Clearly separates use cases: static-only (no backend, no sensitive data), with step-by-step deployment guidance. - Includes real-world cautions and troubleshooting tips for GitHub token permissions and connector limitations.","fileCount":8,"zipByteSize":13625}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17frxc1gxs124qk1qxe2v30ph884mbj:github-pages-publish","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T14:44:49.048Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-gypalyson-creator-github-pages-publish/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":null},"readme":"Skill: github-pages-publish\n\nOwner: gypalyson-creator\n\nSummary: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。\n\nTags: latest:0.1.0\n\nVersion history:\n\nv0.1.0 | 2026-08-17T13:18:09.248Z | auto\n\nInitial release of github-pages-publish.\n\n- Publish existing static website files (HTML or site directory) safely to GitHub Pages and generate a public URL.\n- Supports incremental uploads: never overwrites or force-pushes existing remote files.\n- Provides deploy.py script with three modes: whole site upload, single file upload, or Pages enable-only.\n- Pure Python, standard library only, no extra dependencies.\n- Clearly separates use cases: static-only (no backend, no sensitive data), with step-by-step deployment guidance.\n- Includes real-world cautions and troubleshooting tips for GitHub token permissions and connector limitations.\n\nArchive index:\n\nArchive v0.1.0: 8 files, 13625 bytes\n\nFiles: README.md (3925b), references (0b), references/pages-api.md (5076b), scripts (0b), scripts/deploy.py (8617b), skill-card.md (2690b), SKILL.md (7454b), _meta.json (139b)\n\nFile v0.1.0:SKILL.md\n\n---\r\nname: github-pages-publish\r\ndisplay_name: 静态网页发布器\r\ndescription: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。\r\nagent_created: true\r\n---\r\n\r\n# 静态网页发布器（GitHub Pages）\r\n\r\n## 概述\r\n\r\n本技能把「本地静态文件 → 公开网址」这条链路自动化：创建 GitHub 仓库、上传网页文件、启用 GitHub Pages 自动发布、验证并返回访问地址。适合个人主页、项目介绍页、文档站、汇报页等纯静态站点。\r\n\r\n## 适用与不适用\r\n\r\n**适用**：纯 HTML/CSS/JS 静态内容，无服务端逻辑、无数据库、无登录。\r\n\r\n**不适用（先提醒用户）**：\r\n- 需要后端接口、数据库、用户系统的站点 → 改用 Vercel / 云托管等\r\n- 含敏感数据或客户信息的页面 → Pages 免费版公开可见，禁止托管\r\n\r\n## 前置检查\r\n\r\n1. 确认要部署的静态文件目录，必须包含 `index.html`（否则访问返回 404）。\r\n2. 确认仓库名。规则：\r\n   - 用户/组织主页：仓库名必须是 `<owner>.github.io`，访问地址即 `https://<owner>.github.io`，发布分支用 `main`\r\n   - 项目页：任意仓库名 `repo`，访问地址为 `https://<owner>.github.io/<repo>`，发布分支默认 `gh-pages`\r\n3. 确认站点是否有构建步骤（如 Hugo / Jekyll / 静态生成器）：\r\n   - 无构建 → 直接托管静态文件\r\n   - 有构建 → 需搭配 GitHub Actions workflow（见 `references/pages-api.md`）\r\n\r\n## 部署流程\r\n\r\n### 第一步：确定认证方式\r\n\r\n按优先级探测可用能力，决定走哪条通道：\r\n\r\n1. **GitHub MCP 已连接**（推荐）→ 用 MCP 工具完成仓库创建与文件上传，无需本地 token。注意：MCP 连接器可能是**只读**权限，创建仓库/推送一旦返回 403 `Resource not accessible by integration`，立即改走通道 B（PAT），不要反复重试。\r\n2. **本地有 GitHub token**（环境变量 `GITHUB_TOKEN` / `GH_TOKEN`，或用户提供 PAT）→ 直接运行 `scripts/deploy.py` 或调 REST API 全自动完成。\r\n3. 两者都没有 → 询问用户提供 PAT，或改用 MCP + 手动启用 Pages。\r\n\r\n### 第二步：通道 A —— 通过 GitHub MCP（无需本地 token）\r\n\r\n1. 创建仓库（如不存在）：\r\n   - 调用 GitHub MCP `create_repository`，参数 `name`（仓库名）、`visibility` 设为 `public`（Pages 免费版要求公开）。\r\n2. 上传静态文件：\r\n   - 优先调用 `push_files` 批量上传目录内全部文件（保持相对路径）。\r\n   - 文件多时可用 `create_or_update_file` 逐个创建。\r\n3. 启用 Pages：\r\n   - 运行 `python scripts/deploy.py --enable-only --repo <repo> [--owner <owner>] [--branch <branch>]`；脚本会探测本地 token。\r\n   - 若无 token，脚本会输出精确的手动启用步骤（Settings → Pages → Source 选分支 → Save），引导用户完成这一下。\r\n\r\n### 第三步：通道 B —— 本地脚本全自动（需要 token）\r\n\r\n运行：\r\n\r\n```bash\r\npython scripts/deploy.py --dir <静态文件目录> --repo <仓库名> [--owner <owner>] [--branch gh-pages]\r\n```\r\n\r\n脚本自动完成：创建/复用仓库 → 用 contents API 增量上传文件 → 启用 Pages → 轮询部署状态 → 输出 URL。整站上传采用「逐文件增量同步」：只创建/更新本地有的文件，**绝不覆盖或删除远程已有的其他文件**，从机制上彻底规避 `git push --force` 丢数据的风险。\r\n\r\ntoken 来源：`--token` 参数 > `GITHUB_TOKEN` > `GH_TOKEN`。若均缺失，脚本报错并给出获取 PAT 的指引。\r\n\r\nPAT 权限要求（务必先向用户讲清，否则上传会被 403 拒绝）：\r\n- **classic token**（`ghp_` 开头）：生成时勾选 `repo` 即可。\r\n- **fine-grained token**（`github_pat_` 开头）：默认「Contents」权限为**只读**，必须把 Permissions → Contents 改为 **Read and write**，且 Repository access 覆盖目标仓库（或选 All repositories）。\r\n\r\n### 变体：上传单个文件到现有仓库（不覆盖 index.html）\r\n\r\n当目标仓库已存在且已启用 Pages，只需追加一个页面时，直接用 `deploy.py --file` 或 REST API 上传单个文件，不依赖 git、不会覆盖现有 `index.html`：\r\n\r\n```\r\nPUT /repos/{owner}/{repo}/contents/{英文文件名}.html\r\nBody: { \"message\": \"...\", \"content\": \"<base64 文件内容>\", \"branch\": \"main\" }\r\n```\r\n\r\n文件名用英文（如 `jiuzhaigou-vs-leshan.html`），避免中文文件名导致 URL 被百分号编码。\r\n\r\n### 第四步：验证与交付\r\n\r\n1. 构造访问地址并验证（HTTP 200）：\r\n   - 用户/组织主页：`https://<owner>.github.io`\r\n   - 项目页：`https://<owner>.github.io/<repo>`\r\n   - 单文件：`https://<owner>.github.io/<repo>/<remote-path>`\r\n2. 注意：GitHub Pages 首次部署通常需要 1–3 分钟，刚启用时可能 404，稍等重试。\r\n3. 把最终网址告知用户，或通过 `present_files` 的 URL 模式让用户直接访问。\r\n4. **安全收尾**：部署完成后主动提醒用户，临时 PAT 已用完，可去 `https://github.com/settings/tokens` 撤销（Delete），下次再生成。\r\n\r\n## 自动发布说明\r\n\r\nGitHub Pages 采用「提交即自动发布」：每次向发布分支提交新内容（无论 git push 还是 contents API），GitHub 自动重新构建并部署，无需手动操作。因此「自动发布」无需额外配置即生效。若站点需要构建步骤（静态生成器），改用 GitHub Actions 实现自动构建发布，workflow 模板见 `references/pages-api.md`。\r\n\r\n## 常见问题\r\n\r\n- **刚部署 404**：首次部署需 1–3 分钟；用 REST API `GET /repos/{owner}/{repo}/pages` 查 `status`（building → built），轮询直到 built 再验证。确认仓库 public；确认 `index.html` 在发布分支根目录。\r\n- **上传返回 403 `Resource not accessible by integration`**：GitHub MCP 连接器是只读权限，改用 PAT（通道 B）。\r\n- **上传返回 403 `Resource not accessible by personal access token`**：PAT 缺写入权限——fine-grained token 需把 Contents 设为 Read and write，或改用 classic token 勾 `repo`。\r\n- **更新不生效**：可能是浏览器/CDN 缓存，稍等或强制刷新；确认 push 到了正确的发布分支。\r\n- **私有仓库能否用 Pages**：免费版不行，需 GitHub Pro 等付费订阅。\r\n- **URL 路径**：项目页 URL 包含仓库名，路径区分大小写。\r\n\r\n## 资源\r\n\r\n- `scripts/deploy.py` —— 全自动部署脚本（token 模式）：`--dir` 整站增量上传、`--file` 单文件上传、`--enable-only` 仅启用 Pages；全部走 contents API，无 git、无 force 覆盖\r\n- `references/pages-api.md` —— REST API 端点、GitHub Actions workflow 模板、故障排查\n\nFile v0.1.0:README.md\n\n# GitHub Pages 发布技能（Static Site Publisher）\n\n把你**已经做好的网页**安全地发布到 GitHub Pages，生成谁都能打开的公开链接。\n\n这是一个**通用技能包**，核心是纯 Python 脚本 `deploy.py`，不绑定任何特定平台——既可作为 AI 助手的技能使用，也能直接在命令行独立运行。\n\n---\n\n## 它能帮你做什么\n\n- 手里有一个 HTML 网页文件，想发给别人看 → 一键发到网上，得到链接\n- 有一个完整的网站文件夹 → 整站上线\n- 只想开启自动发布 → 一步搞定\n\n## 特点（为什么安全省心）\n\n- **只新增、不误删**：只创建/更新你指定的文件，绝不覆盖或删除你之前发布的任何内容\n- **不碰你电脑**：只读你指定的文件，不动其他任何本地文件\n- **零依赖**：纯 Python 标准库，无需安装任何第三方包，也不需要 git\n\n---\n\n## 两种使用方式\n\n### 方式一：作为 AI 助手技能使用（对话式）\n\n本技能遵循通用 skill 规范（`SKILL.md`），可被以下平台加载：\n\n- **WorkBuddy**\n- **OpenClaw**\n- 其他支持 skill 规范的 AI Agent 平台\n\n安装：把 `github-pages-publish/` 文件夹放进对应平台的技能目录（例如 WorkBuddy 的 `~/.workbuddy/skills/`），然后在对话里直接说：\n\n- 「把这个网页发到网上」\n- 「部署这个 HTML 文件」\n- 「帮我把这个文件夹上线成网站」\n- 「生成一个能分享的网页链接」\n\n### 方式二：直接命令行运行（不依赖 AI）\n\n`deploy.py` 是纯 Python 脚本，任何装了 Python 的电脑都能直接跑：\n\n```bash\n# 发单个网页 → 生成独立链接\npython deploy.py --file 页面.html --remote-path 页面.html --repo 仓库名 --token <令牌>\n\n# 发整个网站文件夹 → 整站上线\npython deploy.py --dir 网站文件夹 --repo 仓库名 --token <令牌>\n\n# 只开启 Pages（文件已上传时）\npython deploy.py --enable-only --repo 仓库名 --token <令牌>\n```\n\n令牌来源：`--token` 参数 > 环境变量 `GITHUB_TOKEN` > `GH_TOKEN`。\n\n---\n\n## 前提条件\n\n| 条件 | 说明 |\n|------|------|\n| GitHub 账号 | 免费注册即可 |\n| GitHub 令牌（PAT） | 需要「写文件」权限 |\n\n### 生成令牌（约 1 分钟）\n\n1. 打开 https://github.com/settings/tokens\n2. 点「Generate new token」→「Generate new token (classic)」\n3. 只勾选 **`repo`** 这一个权限\n4. 生成后复制那串 `ghp_` 开头的字符\n\n> ⚠️ 用完后可以去同一个页面删掉（Delete），更安全。\n\n---\n\n## 安全说明\n\n- 免费版 GitHub Pages **全网公开**，任何人都能访问，**不要放敏感信息、客户数据、密钥**\n- 本技能只做「发布已有文件」，不做后端、数据库、登录等动态功能\n- 发布完成后建议撤销临时令牌\n\n---\n\n## 目录结构\n\n```\ngithub-pages-publish/（本仓库，即技能文件夹）\n├── README.md              # 使用说明\n├── SKILL.md               # 技能说明（给 AI 看的指令）\n├── scripts/\n│   └── deploy.py          # 部署脚本（三种模式，纯标准库）\n└── references/\n    └── pages-api.md       # API 参考 + 自定义域名 + 故障排查\n```\n\n---\n\n## 常见问题\n\n**Q：发布后打不开（404）？**\n首次发布要等 1–3 分钟，稍等再刷新。\n\n**Q：上传报 403？**\n令牌缺写权限——fine-grained 令牌要把 Contents 改成 Read and write，或改用 classic 令牌勾 `repo`。\n\n**Q：能绑自己的域名吗？**\n可以，见 `references/pages-api.md` 的「自定义域名」小节。\n\n**Q：更新网页后怎么让线上同步？**\n重新发布一次即可，GitHub Pages 会自动刷新。\n\n**Q：这个脚本只能在 WorkBuddy 里用吗？**\n不是。`deploy.py` 是纯 Python，任何环境都能直接运行；`SKILL.md` 遵循通用 skill 规范，WorkBuddy、OpenClaw 等平台都能加载。\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7d3zxgyh6rhvy4ns55djjk4d82nvyp\",\n  \"slug\": \"github-pages-publish\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1786972689248\n}\n\nFile v0.1.0:references/pages-api.md\n\n# GitHub Pages 参考：API、自动构建、故障排查\n\n部署静态站点时按需查阅本文件。\n\n## 关键 REST API 端点\n\n| 操作 | 方法 & 路径 |\n|------|-------------|\n| 创建仓库 | `POST /user/repos`，body `{\"name\": \"...\", \"private\": false}` |\n| 上传/更新单个文件 | `PUT /repos/{owner}/{repo}/contents/{path}`，body `{\"message\", \"content\"(base64), \"branch\"}` |\n| 启用 Pages | `POST /repos/{owner}/{repo}/pages` |\n| 查询 Pages 状态 | `GET /repos/{owner}/{repo}/pages`（`status` 字段：`built` 表示就绪） |\n| 获取当前登录用户 | `GET /user`（用于解析 owner） |\n\n上传单个文件要点（「往现有仓库追加页面」最轻量的方式，不依赖 git、不覆盖已有文件）：\n\n- `content` 需 **base64 编码**。\n- **新建文件**：直接 `PUT` 即可。\n- **更新已有文件**：先 `GET /repos/{owner}/{repo}/contents/{path}` 取 `sha`，再 `PUT` 时带上该 `sha`，否则返回 422。\n- 远程文件名用英文（如 `jiuzhaigou-vs-leshan.html`），避免中文被 URL 百分号编码。\n\n启用 Pages 请求体（legacy 分支模式）：\n\n```json\n{\n  \"build_type\": \"legacy\",\n  \"source\": { \"branch\": \"gh-pages\", \"path\": \"/\" }\n}\n```\n\n请求头（必需）：\n\n```\nAuthorization: Bearer <token>\nAccept: application/vnd.github+json\nX-GitHub-Api-Version: 2022-11-28\nUser-Agent: github-pages-publish\n```\n\n## 访问地址规则\n\n| 仓库类型 | 仓库名 | 访问地址 | 发布分支 |\n|----------|--------|----------|----------|\n| 用户/组织主页 | `<owner>.github.io` | `https://<owner>.github.io` | `main` |\n| 项目页 | 任意 `repo` | `https://<owner>.github.io/<repo>` | `gh-pages`（默认） |\n\n一个账号只能有一个用户主页；项目页数量不限。\n\n## 自定义域名\n\n把默认的 `https://<owner>.github.io/<repo>` 换成自有域名（如 `example.com`）：\n\n1. **仓库根放 `CNAME` 文件**（内容仅一行域名，不带协议）：\n   ```\n   example.com\n   ```\n   用 contents API 上传：`PUT /repos/{owner}/{repo}/contents/CNAME`，内容即域名那一行（发布源是 `gh-pages` 就放到该分支根）。\n2. **DNS 解析**（在域名服务商处配置）：\n   - 子域名（如 `www`）：加 `CNAME` 记录，主机 `www`，值 `<owner>.github.io`。\n   - 裸域（`example.com` 不带 www）：加 `A` 记录指向 GitHub Pages 的 4 个 IP：`185.199.108.153`、`185.199.109.153`、`185.199.110.153`、`185.199.111.153`。\n3. **启用 HTTPS**：仓库 Settings → Pages → Custom domain 填域名 → Save → 勾选 Enforce HTTPS（证书约几分钟自动签发）。\n\n注意：`CNAME` 文件必须常驻仓库，否则自定义域名会失效；一次只能绑一个域名。\n\n## 静态生成器自动构建（GitHub Actions）\n\n若站点需要构建步骤（Hugo / Jekyll / Vite / Astro 等），把 Pages 源设为 `workflow`，并用 Actions 自动构建发布。\n\n`POST /repos/{owner}/{repo}/pages` 改为：\n\n```json\n{ \"build_type\": \"workflow\" }\n```\n\n在仓库 `.github/workflows/pages.yml` 写入（以静态 HTML 为例，改用其他 action 可支持各类生成器）：\n\n```yaml\nname: Deploy to GitHub Pages\non:\n  push:\n    branches: [main]\npermissions:\n  contents: read\n  pages: write\n  id-token: write\nconcurrency:\n  group: pages\n  cancel-in-progress: true\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/configure-pages@v5\n      - uses: actions/upload-pages-artifact@v3\n        with:\n          path: .\n  deploy:\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    runs-on: ubuntu-latest\n    needs: build\n    steps:\n      - id: deployment\n        uses: actions/deploy-pages@v4\n```\n\n若站点有构建命令（Hugo、Vite、`npm run build` 等），在 `build` 任务的 `upload-pages-artifact` 之前插入构建步骤，并把 `path` 指向产物目录：\n\n```yaml\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n      - run: npm ci\n      - run: npm run build\n      - uses: actions/upload-pages-artifact@v3\n        with:\n          path: dist   # 改成实际产物目录\n```\n\n## 故障排查\n\n- **刚部署 404**：首次部署需 1–3 分钟；确认仓库为 public；确认 `index.html` 在发布分支根目录（而非子目录）。\n- **`POST /pages` 返回 409**：Pages 可能已启用或正在初始化，先 `GET` 查询现状。\n- **私有仓库 404/不可用**：免费版 Pages 仅支持 public 仓库；私有需付费订阅。\n- **push 被拒**：确认 token 具备 `repo` scope；确认账号对该仓库有写权限。\n- **更新不生效**：浏览器/CDN 缓存，强制刷新（Ctrl+F5）或稍等；确认改的是发布分支。\n- **自定义域名**：见上文「自定义域名」小节——仓库根放 `CNAME` + DNS 解析 + Enforce HTTPS。\n\n## 安全提醒\n\n- 免费版 Pages 全网公开，禁止托管任何敏感数据、密钥、客户信息、私有报表。\n- 不要把 PAT 写入提交或仓库文件；脚本只在内存和远程 URL 中使用 token。\n\nFile v0.1.0:skill-card.md\n\n## Description:\n\nPublishes an existing static HTML file or static site directory to GitHub Pages and returns a public shareable URL.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[gypalyson-creator](https://clawhub.ai/user/gypalyson-creator)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and external users use this skill to publish already-built static webpages, documentation sites, project pages, or single HTML files to GitHub Pages. It is not intended for backend services, databases, login systems, or content containing sensitive data.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Static files are published to a public GitHub Pages site, which can expose hidden secrets, private reports, customer data, or other sensitive files.\n\nMitigation: Use a clean, reviewed deployment folder with no hidden secrets, .env files, private keys, customer data, or other private content before publishing.\n\nRisk: The uploader can follow symlinked files outside the selected folder and publish content the user did not intend to include.\n\nMitigation: Inspect the deployment directory for symlinks and remove or replace them with reviewed static files before upload.\n\nRisk: A GitHub token with broad or persistent write access can increase impact if it is reused or exposed.\n\nMitigation: Prefer a fine-grained token limited to the target repository with only needed write permissions, and revoke temporary tokens after deployment.\n\nRisk: Publishing to the same remote path may replace an existing file in the target repository.\n\nMitigation: Review remote paths before deployment and use distinct filenames when adding pages to an existing site.\n\n## Reference(s):\n\n- [GitHub Pages API Reference](references/pages-api.md)\n- [Server-resolved source repository](https://github.com/gypalyson-creator/github-pages-publish)\n- [ClawHub skill page](https://clawhub.ai/gypalyson-creator/skills/github-pages-publish)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and optional Python script execution]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May create or update files in a public GitHub repository through GitHub APIs when run with a valid token.]\n\n## Skill Version(s):\n\n0.1.0 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.","readmeExcerpt":"Skill: github-pages-publish Owner: gypalyson-creator Summary: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。 Tags: latest:0.1.0 Version history: v0.1.0 | 2026-08-17T13:18:09.248Z | auto ","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# 发单个网页 → 生成独立链接\npython deploy.py --file 页面.html --remote-path 页面.html --repo 仓库名 --token <令牌>\n\n# 发整个网站文件夹 → 整站上线\npython deploy.py --dir 网站文件夹 --repo 仓库名 --token <令牌>\n\n# 只开启 Pages（文件已上传时）\npython deploy.py --enable-only --repo 仓库名 --token <令牌>"},{"language":"text","snippet":"github-pages-publish/（本仓库，即技能文件夹）\n├── README.md              # 使用说明\n├── SKILL.md               # 技能说明（给 AI 看的指令）\n├── scripts/\n│   └── deploy.py          # 部署脚本（三种模式，纯标准库）\n└── references/\n    └── pages-api.md       # API 参考 + 自定义域名 + 故障排查"},{"language":"json","snippet":"{\n  \"build_type\": \"legacy\",\n  \"source\": { \"branch\": \"gh-pages\", \"path\": \"/\" }\n}"},{"language":"text","snippet":"Authorization: Bearer <token>\nAccept: application/vnd.github+json\nX-GitHub-Api-Version: 2022-11-28\nUser-Agent: github-pages-publish"},{"language":"text","snippet":"example.com"},{"language":"json","snippet":"{ \"build_type\": \"workflow\" }"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\nname: github-pages-publish\r\ndisplay_name: 静态网页发布器\r\ndescription: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。\r\nagent_created: true\r\n---\r\n\r\n# 静态网页发布器（GitHub Pages）\r\n\r\n## 概述\r\n\r\n本技能把「本地静态文件 → 公开网址」这条链路自动化：创建 GitHub 仓库、上传网页文件、启用 GitHub Pages 自动发布、验证并返回访问地址。适合个人主页、项目介绍页、文档站、汇报页等纯静态站点。\r\n\r\n## 适用与不适用\r\n\r\n**适用**：纯 HTML/CSS/JS 静态内容，无服务端逻辑、无数据库、无登录。\r\n\r\n**不适用（先提醒用户）**：\r\n- 需要后端接口、数据库、用户系统的站点 → 改用 Vercel / 云托管等\r\n- 含敏感数据或客户信息的页面 → Pages 免费版公开可见，禁止托管\r\n\r\n## 前置检查\r\n\r\n1. 确认要部署的静态文件目录，必须包含 `index.html`（否则访问返回 404）。\r\n2. 确认仓库名。规则：\r\n   - 用户/组织主页：仓库名必须是 `<owner>.github.io`，访问地址即 `https://<owner>.github.io`，发布分支用 `main`\r\n   - 项目页：任意仓库名 `repo`，访问地址为 `https://<owner>.github.io/<repo>`，发布分支默认 `gh-pages`\r\n3. 确认站点是否有构建步骤（如 Hugo / Jekyll / 静态生成器）：\r\n   - 无构建 → 直接托管静态文件\r\n   - 有构建 → 需搭配 GitHub Actions workflow（见 `references/pages-api.md`）\r\n\r\n## 部署流程\r\n\r\n### 第一步：确定认证方式\r\n\r\n按优先级探测可用能力，决定走哪条通道：\r\n\r\n1. **GitHub MCP 已连接**（推荐）→ 用 MCP 工具完成仓库创建与文件上传，无需本地 token。注意：MCP 连接器可能是**只读**权限，创建仓库/推送一旦返回 403 `Resource not accessible by integration`，立即改走通道 B（PAT），不要反复重试。\r\n2. **本地有 GitHub token**（环境变量 `GITHUB_TOKEN` / `GH_TOKEN`，或用户提供 PAT）→ 直接运行 `scripts/deploy.py` 或调 REST API 全自动完成。\r\n3. 两者都没有 → 询问用户提供 PAT，或改用 MCP + 手动启用 Pages。\r\n\r\n### 第二步：通道 A —— 通过 GitHub MCP（无需本地 token）\r\n\r\n1. 创建仓库（如不存在）：\r\n   - 调用 GitHub MCP `create_repository`，参数 `name`（仓库名）、`visibility` 设为 `public`（Pages 免费版要求公开）。\r\n2. 上传静态文件：\r\n   - 优先调用 `push_files` 批量上传目录内全部文件（保持相对路径）。\r\n   - 文件多时可用 `create_or_update_file` 逐个创建。\r\n3. 启用 Pages：\r\n   - 运行 `python scripts/deploy.py --enable-only --repo <repo> [--owner <owner>] [--branch <branch>]`；脚本会探测本地 token。\r\n   - 若无 token，脚本会输出精确的手动启用步骤（Settings → Pages → Source 选分支 → Save），引导用户完成这一下。\r\n\r\n### 第三步：通道 B —— 本地脚本全自动（需要 token）\r\n\r\n运行：\r\n\r\n```bash\r\npython scripts/deploy.py --dir <静态文件目录> --repo <仓库名> [--owner <owner>] [--branch gh-pages]\r\n```\r\n\r\n脚本自动完成：创建/复用仓库 → 用 contents API 增量上传文件 → 启用 Pages → 轮询部署状态 → 输出 URL。整站上传采用「逐文件增量同步」：只创建/更新本地有的文件，**绝不覆盖或删除远程已有的其他文件**，从机制上彻底规避 `git push --force` 丢数据的风险。\r\n\r\ntoken 来源：`--token` 参数 > `GITHUB_TOKEN` > `GH_TOKEN`。若均缺失，脚本报错并给出获取 PAT 的指引。\r\n\r\nPAT 权限要求（务必先向用户讲清，否则上传会被 403 拒绝）：\r\n- **classic token**（`ghp_` 开头）：生成时勾选 `repo` 即可。\r\n- **fine-grained token**（`github_pat_` 开头）：默认「Contents」权限为**只读**，必须把 Permissions → Contents 改为 **Read and write**，且 Repository access 覆盖目标仓库（或选 All repositories）。\r\n\r\n### 变体：上传单个文件到现有仓库（不覆盖 index.html）\r\n\r\n当目标仓库已存在且已启用 Pages，只需追加一个页面时，直接用 `deploy.py --file` 或 REST API 上传单个文件，不依赖 git、不会覆盖现有 `index.html`：\r\n\r\n```\r\nPUT /repos/{owner}/{repo}/contents/{英文文件名}.html\r\nBody: { \"message\": \"...\", \"content\": \"<base64 文件内容>\", \"branch\": \"main\" }\r\n```\r\n\r\n文件名用英文（如 `jiuzhaigou-vs-leshan.html`），避免中文文件名导致 URL 被百分号编码。\r\n\r\n### 第四步：验证与交付\r\n\r\n1. 构造访问地址并验证（HTTP 200）：\r\n   - 用户/组织主页：`https://<owner>.github.io`\r\n   - 项目页：`https://<owner>.github.io/<rep"},{"path":"README.md","content":"# GitHub Pages 发布技能（Static Site Publisher）\n\n把你**已经做好的网页**安全地发布到 GitHub Pages，生成谁都能打开的公开链接。\n\n这是一个**通用技能包**，核心是纯 Python 脚本 `deploy.py`，不绑定任何特定平台——既可作为 AI 助手的技能使用，也能直接在命令行独立运行。\n\n---\n\n## 它能帮你做什么\n\n- 手里有一个 HTML 网页文件，想发给别人看 → 一键发到网上，得到链接\n- 有一个完整的网站文件夹 → 整站上线\n- 只想开启自动发布 → 一步搞定\n\n## 特点（为什么安全省心）\n\n- **只新增、不误删**：只创建/更新你指定的文件，绝不覆盖或删除你之前发布的任何内容\n- **不碰你电脑**：只读你指定的文件，不动其他任何本地文件\n- **零依赖**：纯 Python 标准库，无需安装任何第三方包，也不需要 git\n\n---\n\n## 两种使用方式\n\n### 方式一：作为 AI 助手技能使用（对话式）\n\n本技能遵循通用 skill 规范（`SKILL.md`），可被以下平台加载：\n\n- **WorkBuddy**\n- **OpenClaw**\n- 其他支持 skill 规范的 AI Agent 平台\n\n安装：把 `github-pages-publish/` 文件夹放进对应平台的技能目录（例如 WorkBuddy 的 `~/.workbuddy/skills/`），然后在对话里直接说：\n\n- 「把这个网页发到网上」\n- 「部署这个 HTML 文件」\n- 「帮我把这个文件夹上线成网站」\n- 「生成一个能分享的网页链接」\n\n### 方式二：直接命令行运行（不依赖 AI）\n\n`deploy.py` 是纯 Python 脚本，任何装了 Python 的电脑都能直接跑：\n\n```bash\n# 发单个网页 → 生成独立链接\npython deploy.py --file 页面.html --remote-path 页面.html --repo 仓库名 --token <令牌>\n\n# 发整个网站文件夹 → 整站上线\npython deploy.py --dir 网站文件夹 --repo 仓库名 --token <令牌>\n\n# 只开启 Pages（文件已上传时）\npython deploy.py --enable-only --repo 仓库名 --token <令牌>\n```\n\n令牌来源：`--token` 参数 > 环境变量 `GITHUB_TOKEN` > `GH_TOKEN`。\n\n---\n\n## 前提条件\n\n| 条件 | 说明 |\n|------|------|\n| GitHub 账号 | 免费注册即可 |\n| GitHub 令牌（PAT） | 需要「写文件」权限 |\n\n### 生成令牌（约 1 分钟）\n\n1. 打开 https://github.com/settings/tokens\n2. 点「Generate new token」→「Generate new token (classic)」\n3. 只勾选 **`repo`** 这一个权限\n4. 生成后复制那串 `ghp_` 开头的字符\n\n> ⚠️ 用完后可以去同一个页面删掉（Delete），更安全。\n\n---\n\n## 安全说明\n\n- 免费版 GitHub Pages **全网公开**，任何人都能访问，**不要放敏感信息、客户数据、密钥**\n- 本技能只做「发布已有文件」，不做后端、数据库、登录等动态功能\n- 发布完成后建议撤销临时令牌\n\n---\n\n## 目录结构\n\n```\ngithub-pages-publish/（本仓库，即技能文件夹）\n├── README.md              # 使用说明\n├── SKILL.md               # 技能说明（给 AI 看的指令）\n├── scripts/\n│   └── deploy.py          # 部署脚本（三种模式，纯标准库）\n└── references/\n    └── pages-api.md       # API 参考 + 自定义域名 + 故障排查\n```\n\n---\n\n## 常见问题\n\n**Q：发布后打不开（404）？**\n首次发布要等 1–3 分钟，稍等再刷新。\n\n**Q：上传报 403？**\n令牌缺写权限——fine-grained 令牌要把 Contents 改成 Read and write，或改用 classic 令牌勾 `repo`。\n\n**Q：能绑自己的域名吗？**\n可以，见 `references/pages-api.md` 的「自定义域名」小节。\n\n**Q：更新网页后怎么让线上同步？**\n重新发布一次即可，GitHub Pages 会自动刷新。\n\n**Q：这个脚本只能在 WorkBuddy 里用吗？**\n不是。`deploy.py` 是纯 Python，任何环境都能直接运行；`SKILL.md` 遵循通用 skill 规范，WorkBuddy、OpenClaw 等平台都能加载。"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7d3zxgyh6rhvy4ns55djjk4d82nvyp\",\n  \"slug\": \"github-pages-publish\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1786972689248\n}"},{"path":"references/pages-api.md","content":"# GitHub Pages 参考：API、自动构建、故障排查\n\n部署静态站点时按需查阅本文件。\n\n## 关键 REST API 端点\n\n| 操作 | 方法 & 路径 |\n|------|-------------|\n| 创建仓库 | `POST /user/repos`，body `{\"name\": \"...\", \"private\": false}` |\n| 上传/更新单个文件 | `PUT /repos/{owner}/{repo}/contents/{path}`，body `{\"message\", \"content\"(base64), \"branch\"}` |\n| 启用 Pages | `POST /repos/{owner}/{repo}/pages` |\n| 查询 Pages 状态 | `GET /repos/{owner}/{repo}/pages`（`status` 字段：`built` 表示就绪） |\n| 获取当前登录用户 | `GET /user`（用于解析 owner） |\n\n上传单个文件要点（「往现有仓库追加页面」最轻量的方式，不依赖 git、不覆盖已有文件）：\n\n- `content` 需 **base64 编码**。\n- **新建文件**：直接 `PUT` 即可。\n- **更新已有文件**：先 `GET /repos/{owner}/{repo}/contents/{path}` 取 `sha`，再 `PUT` 时带上该 `sha`，否则返回 422。\n- 远程文件名用英文（如 `jiuzhaigou-vs-leshan.html`），避免中文被 URL 百分号编码。\n\n启用 Pages 请求体（legacy 分支模式）：\n\n```json\n{\n  \"build_type\": \"legacy\",\n  \"source\": { \"branch\": \"gh-pages\", \"path\": \"/\" }\n}\n```\n\n请求头（必需）：\n\n```\nAuthorization: Bearer <token>\nAccept: application/vnd.github+json\nX-GitHub-Api-Version: 2022-11-28\nUser-Agent: github-pages-publish\n```\n\n## 访问地址规则\n\n| 仓库类型 | 仓库名 | 访问地址 | 发布分支 |\n|----------|--------|----------|----------|\n| 用户/组织主页 | `<owner>.github.io` | `https://<owner>.github.io` | `main` |\n| 项目页 | 任意 `repo` | `https://<owner>.github.io/<repo>` | `gh-pages`（默认） |\n\n一个账号只能有一个用户主页；项目页数量不限。\n\n## 自定义域名\n\n把默认的 `https://<owner>.github.io/<repo>` 换成自有域名（如 `example.com`）：\n\n1. **仓库根放 `CNAME` 文件**（内容仅一行域名，不带协议）：\n   ```\n   example.com\n   ```\n   用 contents API 上传：`PUT /repos/{owner}/{repo}/contents/CNAME`，内容即域名那一行（发布源是 `gh-pages` 就放到该分支根）。\n2. **DNS 解析**（在域名服务商处配置）：\n   - 子域名（如 `www`）：加 `CNAME` 记录，主机 `www`，值 `<owner>.github.io`。\n   - 裸域（`example.com` 不带 www）：加 `A` 记录指向 GitHub Pages 的 4 个 IP：`185.199.108.153`、`185.199.109.153`、`185.199.110.153`、`185.199.111.153`。\n3. **启用 HTTPS**：仓库 Settings → Pages → Custom domain 填域名 → Save → 勾选 Enforce HTTPS（证书约几分钟自动签发）。\n\n注意：`CNAME` 文件必须常驻仓库，否则自定义域名会失效；一次只能绑一个域名。\n\n## 静态生成器自动构建（GitHub Actions）\n\n若站点需要构建步骤（Hugo / Jekyll / Vite / Astro 等），把 Pages 源设为 `workflow`，并用 Actions 自动构建发布。\n\n`POST /repos/{owner}/{repo}/pages` 改为：\n\n```json\n{ \"build_type\": \"workflow\" }\n```\n\n在仓库 `.github/workflows/pages.yml` 写入（以静态 HTML 为例，改用其他 action 可支持各类生成器）：\n\n```yaml\nname: Deploy to GitHub Pages\non:\n  push:\n    branches: [main]\npermissions:\n  contents: read\n  pages: write\n  id-token: write\nconcurrency:\n  group: pages\n  cancel-in-progress: true\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/configure-pages@v5\n      - uses: actions/upload-pages-artifact@v3\n        with:\n          path: .\n  deploy:\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    runs-on: ubuntu-latest\n    needs: build\n    steps:\n      - id: deployment\n        uses: actions/deploy-pages@v4\n```\n\n若站点有构建命令（Hugo、Vite、`npm run build` 等），在 `build` 任务的 `upload-pages-artifact` 之前插入构建步骤，并把 `path` 指向产物目录：\n\n```yaml\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n      - run: npm ci\n      - run: npm run build\n      - uses: actions/upload-"},{"path":"skill-card.md","content":"## Description:\n\nPublishes an existing static HTML file or static site directory to GitHub Pages and returns a public shareable URL.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[gypalyson-creator](https://clawhub.ai/user/gypalyson-creator)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and external users use this skill to publish already-built static webpages, documentation sites, project pages, or single HTML files to GitHub Pages. It is not intended for backend services, databases, login systems, or content containing sensitive data.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Static files are published to a public GitHub Pages site, which can expose hidden secrets, private reports, customer data, or other sensitive files.\n\nMitigation: Use a clean, reviewed deployment folder with no hidden secrets, .env files, private keys, customer data, or other private content before publishing.\n\nRisk: The uploader can follow symlinked files outside the selected folder and publish content the user did not intend to include.\n\nMitigation: Inspect the deployment directory for symlinks and remove or replace them with reviewed static files before upload.\n\nRisk: A GitHub token with broad or persistent write access can increase impact if it is reused or exposed.\n\nMitigation: Prefer a fine-grained token limited to the target repository with only needed write permissions, and revoke temporary tokens after deployment.\n\nRisk: Publishing to the same remote path may replace an existing file in the target repository.\n\nMitigation: Review remote paths before deployment and use distinct filenames when adding pages to an existing site.\n\n## Reference(s):\n\n- [GitHub Pages API Reference](references/pages-api.md)\n- [Server-resolved source repository](https://github.com/gypalyson-creator/github-pages-publish)\n- [ClawHub skill page](https://clawhub.ai/gypalyson-creator/skills/github-pages-publish)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and optional Python script execution]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May create or update files in a public GitHub repository through GitHub APIs when run with a valid token.]\n\n## Skill Version(s):\n\n0.1.0 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。 Skill: github-pages-publish Owner: gypalyson-creator Summary: 把「已有的」静态网页文件（单个 HTML 或整个网站目录）安全发布到 GitHub Pages，生成可公开访问、能分享的网址链接。当用户已有现成网页，想「发到网上」「部署上线」「发布网页」「生成分享链接」时使用；本技能只做「发布已有文件」，不负责从零生成网站。提供可执行的 deploy.py 脚本（整站增量上传 / 单文件上传 / 仅启用 Pages 三种模式），纯标准库无额外依赖，逐文件增量上传、绝不覆盖远程已有内容，并已回写真实踩坑（token 写权限、连接器只读、force 覆盖风险）。仅适用于纯静态内容；涉及后端、数据库、登录或敏感数据时不要用。 Tags: latest:0.1.0 Version history: v0.1.0 | 2026-08-17T13:18:09.248Z | auto","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1243,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T12:26:03.199Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T14:44:49.048Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}