Merge pull request 'fix(digest): digest 暂存改 mktemp(PLAT-014 二段,v5 前置)' (#3) from task/PLAT-014-digest-mktemp into main

This commit was merged in pull request #3.
This commit is contained in:
2026-08-31 13:41:00 +00:00
@@ -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