Skip to content

Commit 594a8f1

Browse files
authored
fix: version-bump-check parser silently passes all PRs (#28)
The version-bump-check job in validate.yml uses git log --pretty=format:'%H%x00%s%x00%b%x1e' to extract commits and parse them. Bash command substitution silently strips \0 bytes (with a warning to stderr that nothing inspects), gluing SHA+SUBJECT+BODY into one field. The regex that extracts conventional-commit prefixes never matched, so the check has been silently passing every PR since 2026-04-22 (commit f27e37f). PR #22 (DTD#4 fix) was a fix:-prefixed PR that did not bump VERSION. The check should have failed it but did not, allowing the PR to merge and causing the next release to fail. Replaces \x00 with \x1f (Unit Separator) which preserves through bash command substitution. The record separator (\x1e Record Separator) was already safe and is unchanged. The awk -F arguments are updated to match. Closes #24. Signed-off-by: 154358121+TMHSDigital@users.noreply.github.com Made-with: Cursor Signed-off-by: 154358121+TMHSDigital@users.noreply.github.com
1 parent 5772b15 commit 594a8f1

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/validate.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ jobs:
196196
run: |
197197
set -euo pipefail
198198
199-
COMMITS="$(git log "${BASE_SHA}..${HEAD_SHA}" --pretty=format:'%H%x00%s%x00%b%x1e')"
199+
# DTD#24: field separator must NOT be NUL (\x00). Bash command
200+
# substitution silently strips NUL bytes (with a warning to
201+
# stderr that nothing inspects), gluing SHA+SUBJECT+BODY into
202+
# one field and breaking the awk parse downstream. Use \x1f
203+
# (Unit Separator) which preserves cleanly through bash. The
204+
# record separator (\x1e Record Separator) was already safe.
205+
COMMITS="$(git log "${BASE_SHA}..${HEAD_SHA}" --pretty=format:'%H%x1f%s%x1f%b%x1e')"
200206
201207
if [ -z "$COMMITS" ]; then
202208
echo "No new commits to check."
@@ -206,9 +212,9 @@ jobs:
206212
NEEDS_BUMP="false"
207213
while IFS= read -r -d $'\x1e' record; do
208214
[ -z "$record" ] && continue
209-
SHA="$(echo "$record" | awk -F '\0' '{print $1}')"
210-
SUBJECT="$(echo "$record" | awk -F '\0' '{print $2}')"
211-
BODY="$(echo "$record" | awk -F '\0' '{print $3}')"
215+
SHA="$(echo "$record" | awk -F $'\x1f' '{print $1}')"
216+
SUBJECT="$(echo "$record" | awk -F $'\x1f' '{print $2}')"
217+
BODY="$(echo "$record" | awk -F $'\x1f' '{print $3}')"
212218
213219
# Escape hatch: commit opts out.
214220
if echo "$SUBJECT $BODY" | grep -qF '[skip version]'; then

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.4
1+
1.8.5

0 commit comments

Comments
 (0)