fix: buffer git log output in ci_skip_requested to avoid SIGPIPE

What

Buffer git log output into a variable before grepping in ci_skip_requested(), fixing a flaky SIGPIPE failure under set -o pipefail.

Why

grep -q exits on first match and closes the read end of the pipe. If git log is still streaming (large history), it gets SIGPIPE (exit 141). Under pipefail, the pipeline takes that non-zero exit, so && return 0 never fires — the skip tag is present but reported as absent.

This is timing-dependent: it only triggers when grep -q short-circuits before git log finishes writing. Observed on !1592 (merged) — an ETL-only change with [skip schema-version-check] in the commit message still failed the local lefthook.

How it works

Before (buggy):

git log "${BASE_REF}"...HEAD --format=%B 2>/dev/null | grep -qF "${tag}" && return 0

After (fixed):

local msgs
msgs="$(git log "${BASE_REF}"...HEAD --format=%B 2>/dev/null)" || true
echo "$msgs" | grep -qF "${tag}" && return 0

Buffering eliminates the producer/consumer race entirely.

How to test

  1. Commit a change to config/ontology/ with [skip schema-version-check] in the commit message
  2. Run bash scripts/check-schema-version.sh origin/main
  3. Confirm it exits 0 (skip detected)

Closes #834 (closed)

Merge request reports

Loading