From 87ef17c3fdb44cb273071f27f7e65119355c2efd Mon Sep 17 00:00:00 2001 From: Chris Shuttlesworth Date: Tue, 28 Jul 2026 07:06:12 -0400 Subject: [PATCH] fix: report the real layer count in the skip message (#23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skip path logged "5 identical layers" for a 4-layer image. layers() ends with `tr '\n' ','`, leaving a trailing comma, so `wc -l` counts a phantom empty line. Cosmetic — the comparison itself is unaffected, since both sides carry the same trailing comma — but a shared workflow that prints a number contradicting the image will send someone chasing a discrepancy that does not exist. Verified against the live manifest: wc -l says 5, grep -c says 4, the image has 4. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/mirror-image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mirror-image.yml b/.github/workflows/mirror-image.yml index cccb992..57451ee 100644 --- a/.github/workflows/mirror-image.yml +++ b/.github/workflows/mirror-image.yml @@ -122,7 +122,9 @@ jobs: fi if [ "$up" = "$mine" ]; then echo "stale=false" >> "$GITHUB_OUTPUT" - echo "mirror is current — $(echo "$up" | tr ',' '\n' | wc -l) identical layers, nothing to copy" + # grep -c . not wc -l: layers() leaves a trailing comma, so wc counts a + # phantom empty line and reports one more layer than the image has. + echo "mirror is current — $(echo "$up" | tr ',' '\n' | grep -c .) identical layers, nothing to copy" else echo "stale=true" >> "$GITHUB_OUTPUT" echo "mirror differs from upstream (or is absent) — copying"