Summary
gh_report_command_failure in lib/bash/gh/lib_gh.sh uses $* to format the failing command in its error message, causing arguments with embedded spaces to lose their boundaries.
Root cause
gh_report_command_failure() {
local status="$1"
shift
log_error "GitHub command failed: gh $*" # ← $* joins args with IFS (space)
...
}
$* inside double quotes expands positional parameters joined by the first character of IFS (a space). An invocation like:
gh_run issue create --title "my PR title"
logs:
GitHub command failed: gh issue create --title my PR title
The quoted argument boundary is gone. A reader cannot tell whether my PR title is one argument or three.
Fix
Use printf '%q ' to build a shell-quoted representation:
local printable_args
printf -v printable_args '%q ' "$@"
log_error "GitHub command failed: gh ${printable_args% }"
This matches how __std_run_impl__ formats commands for its error messages.
Summary
gh_report_command_failureinlib/bash/gh/lib_gh.shuses$*to format the failing command in its error message, causing arguments with embedded spaces to lose their boundaries.Root cause
$*inside double quotes expands positional parameters joined by the first character ofIFS(a space). An invocation like:gh_run issue create --title "my PR title"logs:
The quoted argument boundary is gone. A reader cannot tell whether
my PR titleis one argument or three.Fix
Use
printf '%q 'to build a shell-quoted representation:This matches how
__std_run_impl__formats commands for its error messages.