From 5de20d5723b9c76f566aa58dc1cc8f127018f2a8 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 27 Nov 2026 19:42:00 +0800 Subject: [PATCH] ci: keep image scan outputs out of docs/ Default scan reports to .build and refuse writing under docs/. Co-authored-by: Cursor --- ci/images/scan.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/images/scan.sh b/ci/images/scan.sh index ad25dd9..e5abc45 100755 --- a/ci/images/scan.sh +++ b/ci/images/scan.sh @@ -7,16 +7,27 @@ # - a fail-closed provenance check that consumers pin immutable tags # # Usage: -# ci/images/scan.sh [--out docs/evidence/ci-image-scan] +# ci/images/scan.sh [--out ] +# Output is a CI/local artifact directory only. Do not commit scan reports into +# the repository; record results on the tracking Issue or as pipeline assets. set -euo pipefail root="$(cd "$(dirname "$0")/../.." && pwd)" registry="${MARQDO_CI_REGISTRY:-git.cflmy.cn/cflmy}" version="${MARQDO_CLI_VERSION:-3.0.0-rc.5}" -out="${1:-$root/docs/evidence/ci-image-scan-$version}" +out="$root/.build/ci-image-scan-$version" if [[ "${1:-}" == "--out" ]]; then out="${2:?}" +elif [[ -n "${1:-}" ]]; then + out="$1" fi mkdir -p "$out" +# Refuse to write under tracked docs/ — that inflates the repository. +case "$out" in + "$root/docs"|"$root/docs"/*) + echo "scan.sh: refuse output under docs/; use .build/ or a CI workspace" >&2 + exit 2 + ;; +esac images=( "marqdo-ci-shell:$version" "marqdo-ci-rust:$version"