fix(digest): digest 汇总文件改 mktemp(PLAT-014 二段:宿主非 root 撞容器 chown 后的 workspace)

run 924 build 红根因:容器 install chown -R node:node workspace → 宿主 digest 步
mkdir -p .tmp-ci EACCES(897 时代 runner 为 root 故绿;治理后必红)。
修法:digest/manifest 暂存文件改宿主 mktemp 目录(runner 自建 tmp 可写),
两处 digest 步(verify/script 路径)同修。合并后打 v5。
This commit is contained in:
2026-08-31 21:35:12 +08:00
parent 973ed6cb99
commit 4d9a785ec5
@@ -193,8 +193,11 @@ jobs:
set -eu
IMAGE_TAG="git-${GITHUB_SHA}"
printf '%s' "${GITHUB_SHA}" | grep -Eq '^[0-9a-f]{40}$'
mkdir -p .tmp-ci
digest_file=".tmp-ci/digests.txt"
# PLAT-014: the containerized install chowns the workspace to the
# helper's node user, so a host-side mkdir in $PWD fails with EACCES
# on the non-root runner. Keep host-written scratch in mktemp space.
digest_dir="$(mktemp -d)"
digest_file="$digest_dir/digests.txt"
: >"$digest_file"
cache_args=""
if [ -n "${CACHE_REGISTRY_REF}" ]; then
@@ -248,7 +251,7 @@ jobs:
--provenance=mode=max \
--sbom=true \
--push .
manifest_file=".tmp-ci/index-${service}.json"
manifest_file="${digest_dir}/index-${service}.json"
docker buildx imagetools inspect "${image}" --raw >"$manifest_file"
if [ -n "${VERIFY_COMMAND}" ]; then
# VERIFY_COMMAND carries its own interpreter (e.g. "node x.mjs"
@@ -284,8 +287,8 @@ jobs:
run: |
set -eu
image_tag="git-${GITHUB_SHA}"
digest_file=".tmp-ci/digests-script.txt"
mkdir -p .tmp-ci
digest_dir="$(mktemp -d)"
digest_file="${digest_dir}/digests-script.txt"
: >"$digest_file"
while IFS='|' read -r service dockerfile target; do
[ -n "${service:-}" ] || continue