From fb2d82095d7a06dd6c3460df3c4879a86295a272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=80=E5=B0=8F=E4=BA=91?= Date: Wed, 4 Nov 2026 11:17:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=AF=E8=A7=81=E6=80=A7=E6=A0=A1?= =?UTF-8?q?=E6=AD=A3=E6=94=B9=E7=94=A8=20Gitee=20=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AB=AF=E7=82=B9=EF=BC=88=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E4=BB=93=E7=AB=AF=E7=82=B9=E6=97=A0=E6=95=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/mirror-to-gitee.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/mirror-to-gitee.yml b/.gitea/workflows/mirror-to-gitee.yml index c1c981e..0c677fe 100644 --- a/.gitea/workflows/mirror-to-gitee.yml +++ b/.gitea/workflows/mirror-to-gitee.yml @@ -97,14 +97,17 @@ jobs: fi echo "✅ 校验通过:Gitee 端 main 与 tag 均已对齐" - # 门户是公开项目门户,目标仓必须是公开的,否则不会出现在企业仓列表页里 + # 门户是公开项目门户,目标仓必须是公开的,否则不会出现在企业仓列表页里。 + # 仓库可见性的更新端点是 PATCH /api/v5/repos/{owner}/{repo}; + # /enterprises/{owner}/repos/{repo} 不是有效端点(会 404)。 + # 企业仓可见性有三档(公开 / 企业内 / 私有),公开需要 private 与 internal 都为 false。 echo "----- 校正目标仓可见性为公开" curl -sS -X PATCH \ - "https://gitee.com/api/v5/enterprises/${DST_OWNER}/repos/${REPO_NAME}?access_token=${DST_TOKEN}" \ + "https://gitee.com/api/v5/repos/${DST_OWNER}/${REPO_NAME}?access_token=${DST_TOKEN}" \ -H 'Content-Type: application/json' \ - -d '{"private":false}' \ + -d '{"private":false,"internal":false}' \ -o /tmp/repo-patch.json -w '改可见性 HTTP %{http_code}\n' || true - head -c 200 /tmp/repo-patch.json 2>/dev/null; echo + head -c 300 /tmp/repo-patch.json 2>/dev/null; echo exit 0 fi wait_s=$((attempt * 30))