Files
gitea/skills/repo-sync/SKILL.md
T
jiantw83 ccf4b2af24 fix(wiki,repo-sync): Gitea 認證缺值改詢問使用者
什麼:wiki 與 repo-sync 兩支技能在 GITEA_HOST/GITEA_TOKEN 無法解析時,原本只回報認證失敗;現在改為先走 jsc-ask:ask 詢問使用者。同步將 jsc-gitea 版本號由 0.0.4 升至 0.0.5。

為什麼:guidelines 的環境變數表規定無法解析的必要環境變數要詢問使用者,不能直接回報失敗;先前兩支技能的行為不符合 jsc-meta:skill-check 的稽核規則。

如何:在 skills/wiki/SKILL.md 與 skills/repo-sync/SKILL.md 呼叫 tools/gitea.sh 前,先檢查 GITEA_HOST/GITEA_TOKEN 是否可解析(含 tea login list 的備援 token),無法解析時依 jsc-ask:ask 的決策樹詢問使用者;同時將 plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 的版本號由 0.0.4 升至 0.0.5。

負責功能:Gitea 認證缺值改詢問使用者(wiki、repo-sync 兩技能共用的根因修正)。
2026-08-24 14:47:40 +08:00

1.6 KiB

name, description
name description
repo-sync Batch-sync all readable repos of a chosen Gitea owner into the working directory. List owners, let the user pick, then clone or update each repo; local changes become a branch, commit, push, and PR to develop or master. Use for workspace bootstrap or bulk refresh; not for a single repo.

repo-sync — batch-sync repositories

Steps

  1. Before calling tools/gitea.sh, resolve GITEA_HOST and GITEA_TOKEN from the current shell environment (also check tea login list for a usable login token when GITEA_TOKEN is unset). If GITEA_HOST is unresolvable, or GITEA_TOKEN is unset and no tea login token exists either, ask the user for the missing value per the jsc-ask:ask rules before proceeding to any tools/gitea.sh call.
  2. Run tools/gitea.sh owners to list every {owner} the user can read.
  3. Ask the user which {owner} to sync, per the jsc-ask:ask rules. Every option states the owner's repo count and impact scope.
  4. Run tools/gitea.sh repos {owner} to list every readable {repo} under that owner.
  5. Sync each {repo} one by one. This step MUST run as a sub agent (one sub agent per repo):
    1. Missing locally → git clone into the working directory (clone URL from tools/gitea.sh clone-url).
    2. Present locally → switch to develop, else master (or the result of tools/gitea.sh default-branch), then git pull.
    3. Local file changes → create a branch from develop or master, commit via jsc-git:commit, push, then open a PR back to develop or master via jsc-git:pr.
  6. Report the sync result for every repo: cloned, updated, PR created, or the failure reason.