fix(ci): publish images after large mixed diffs (#13011)

Quiet grep exits on the first image-visible path. Under pipefail,
echo can then fail with SIGPIPE and the gate incorrectly skips images.

Consume the full path list without changing the exclusion rules.
Test the actual workflow gate with disposable Git history, including
large mixed diffs, and run the regression in the lightweight lint job.

Assisted-by: nib:gpt-6.1-sol

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
mudler-agentandEttore Di Giacinto authored and GitHub committed 2026-11-01 15:43:32 +01:00
1 parent 968c6651ae
commit 9bd5d0f915
3 files changed
+163 -1

No files matched your search

+2 -1
View File
@@ -52,7 +52,8 @@
files="$(git diff --name-only "${BEFORE}" "${AFTER}")"
echo "changed files:"; echo "${files:-<none>}"
[ -z "${files}" ] && emit true "empty diff: building every image"
if echo "${files}" | grep -qvE '^(gallery/|docs/|examples/)|\.md$'; then
# Consume every path so an early match cannot SIGPIPE echo under pipefail.
if echo "${files}" | grep -vE '^(gallery/|docs/|examples/)|\.md$' >/dev/null; then
emit true "push touches image-visible content: building"
fi
emit false "only gallery/docs/markdown changed: images identical, skipping"
+4
View File
@@ -125,6 +125,10 @@ jobs:
- name: run CI script tests
run: make test-ci-scripts
# Exercise the actual publication gate without building any images.
- name: test image publication gate
run: python3 .github/ci/test-image-publication-gate.py
# The shared python backend helpers (Options[] parsing, engine-arg
# mapping, model reference resolution) are stdlib-only, so their tests
# ride along here instead of waiting on a multi-GB backend image build.