ci(release): gh release download 需显式 --repo(非 git 目录无法推断)

## 症状(第三次试发布)

Build 全绿、tag 已建、release 已建、2.40GB 附件全部上传成功 ——
唯独最后一道「回读校验」失败,整个 workflow 因此标记为 failure:

    failed to run git: fatal: not a git repository (or any of the
    parent directories): .git
    ##[error]Process completed with exit code 1.

## 根因

回读校验为了"下一份干净副本"先 `cd /tmp/back`,那里不是 git 仓库。
而 `gh release download` 默认从**当前目录的 git 上下文**推断仓库与
host(GITHUB_REPOSITORY / GH_HOST 之类环境变量不足以让它跳过推断),
于是报 "not a git repository"。

## 修法

    gh release download "$TAG" --repo "$GITHUB_REPOSITORY"

两个仓的 workflow 都有同一处(主仓 + SDK),一并修。

## 顺带

`third_party/homeagent-sdk/.github/` 加入 .gitignore —— 与 skills/ 同类:
SDK 仓自己的 workflow 由 SDK 仓跟踪管理(那边已跟踪),本仓不参与
构建,不需要在这边重复一份。未加规则时它会出现在本仓的未跟踪列表里。
This commit is contained in:
JianFeeeee
2026-09-29 14:39:08 +08:00
parent 91fc5093d1
commit 192e63cf52
2 changed files with 9 additions and 1 deletions

View File

@ -329,7 +329,12 @@ jobs:
set -euo pipefail
mkdir -p /tmp/back
cd /tmp/back
gh release download "$TAG"
# ★ 必须显式 --repo:gh 默认从**当前目录的 git 上下文**推断仓库,
# 而 /tmp/back 不是 git 仓库 ⇒ 报
# "failed to run git: fatal: not a git repository"。
# 首次试发布就死在这里 —— 产物其实全部上传成功(tag 与
# release 已建、2.40GB 附件齐备),只是这道回读校验自己失败了。
gh release download "$TAG" --repo "$GITHUB_REPOSITORY"
for f in *; do
printf " %8.1fMB %s\n" \
"$(stat -c %s "$f" | awk '{print $1/1048576}')" "$f"