What changed, and why it matters
This is a shell script maintenance fix for the project's continuous integration (CI) semver-checking script. It changes how a temporary directory cleanup command is captured so the cleanup actually runs correctly, and switches the trigger from function return to script exit. There is no security issue here.
No security action needed. Treat as a normal CI maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies contrib/check-semver.sh. The trap cleanup for removing a git worktree was using single quotes with a RETURN trap inside a function, which meant the local variable $baseline_dir would not be expanded at trap definition time and the RETURN trap could fire multiple times. The fix uses double-quoted trap string (with shellcheck suppression SC2064) to capture the current variable values, and changes the trap signal from RETURN to EXIT so it fires once when the script exits. This is a CI reliability/correctness fix, not a security patch.
Changed components
contrib/check-semver.shInspect captured patch +3 / −1
diff --git a/contrib/check-semver.sh b/contrib/check-semver.sh
index 86b28a1b..a5d430b6 100755
--- a/contrib/check-semver.sh
+++ b/contrib/check-semver.sh
@@ -154,7 +154,9 @@ check_semver_breaks() {
# work correctly while keeping the baseline repo lightweight.
local baseline_dir
baseline_dir=$(mktemp -d)
- trap 'git -C "$WORKSPACE_ROOT" worktree remove "$baseline_dir"' RETURN
+ # Capture variables now for the trap since they are local.
+ # shellcheck disable=SC2064
+ trap "git -C $WORKSPACE_ROOT worktree remove ${baseline_dir}" EXIT
git -C "$WORKSPACE_ROOT" worktree add "$baseline_dir" "$BASELINE_COMMIT"
local has_breaks=false
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.