From 0b384a58f5a046f4f22b41b125a250be8052ba13 Mon Sep 17 00:00:00 2001 From: JustMe Date: Thu, 8 Oct 2026 05:43:51 +0800 Subject: [PATCH] fix: hash the node binary without the registry auth file that does not exist yet [CI] --- ci/binary-hash.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/binary-hash.sh b/ci/binary-hash.sh index a95b64f..f9d07ea 100644 --- a/ci/binary-hash.sh +++ b/ci/binary-hash.sh @@ -4,6 +4,8 @@ # 先试在镜像里运行 sha256sum(同架构),不行再挂载镜像文件系统直接读。 set -euo pipefail image="${1:?usage: binary-hash.sh }"; path="${2:?path in the image}" +# 镜像是本地刚构建的,不需要仓库认证;CI 里 REGISTRY_AUTH_FILE 指向的文件在登录之前还不存在,buildah 会因此报错 +unset REGISTRY_AUTH_FILE container="$(buildah from "$image")" trap 'buildah rm "$container" >/dev/null 2>&1 || true' EXIT if out="$(buildah run "$container" -- sha256sum "$path" 2>/dev/null)" && [[ "$out" =~ ^([0-9a-f]{64})[[:space:]] ]]; then