fix(preflight): avoid jq SIGPIPE race in verify-changelog-sync
The Block C check used `jq -r '.[0].Changelog' | grep -qE ...` to spot the **vX.Y.Z** marker. With `set -o pipefail`, grep -q closing stdin on the first match makes jq trip SIGPIPE on the rest of the multi-KB Changelog string, which the script then surfaces as a false-positive "Changelog missing **vX.Y.Z** subblock" failure. Interactive shells sometimes raced through fast enough to hide the issue, but the pre-push runner hit it reliably (saw it on the v1.4.10 release-cut push attempt). Switched the pipe to a process substitution so jq writes into a FIFO and SIGPIPE never enters the picture. Both directions of the marker check now stay deterministic.
This commit is contained in:
@@ -19,7 +19,12 @@ TAG="v$VER"
|
||||
grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" "$YAML" \
|
||||
|| fail "$YAML changelog missing **v${VER}** subblock. Fix: add the v${VER} block at the top of the changelog field."
|
||||
|
||||
jq -r '.[0].Changelog' "$REPO_JSON" | grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" \
|
||||
# Process substitution instead of `jq | grep -q` — grep -q closes stdin on the
|
||||
# first match, jq keeps writing the multi-KB Changelog string and trips SIGPIPE,
|
||||
# which `set -o pipefail` then turns into a false-positive FAIL. Manifested as a
|
||||
# `jq: writing output failed: Broken pipe` line plus a misleading "Changelog
|
||||
# missing **vX.Y.Z** subblock" message during pre-push runs.
|
||||
grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" <(jq -r '.[0].Changelog' "$REPO_JSON") \
|
||||
|| fail "$REPO_JSON Changelog missing **v${VER}** subblock. Fix: copy the yaml changelog over."
|
||||
|
||||
FORGE_FILE="$FORGE_DIR/${TAG}.md"
|
||||
|
||||
Reference in New Issue
Block a user