diff --git a/nix/packages/hive-forge-tools.nix b/nix/packages/hive-forge-tools.nix index 2b2cbda..188b279 100644 --- a/nix/packages/hive-forge-tools.nix +++ b/nix/packages/hive-forge-tools.nix @@ -148,6 +148,9 @@ pkgs.writeShellApplication { else _body="$*" fi + if [ -z "$(printf '%s' "$_body" | tr -d '[:space:]')" ]; then + echo "hive-forge comment: refusing to post empty comment body" >&2; exit 1 + fi local _payload _payload=$(jq -n --arg body "$_body" '{body:$body}') forge_post "$FORGE_API/repos/$_repo/issues/$_n/comments" "$_payload" \ @@ -174,6 +177,9 @@ pkgs.writeShellApplication { _body="$1"; shift if [ $# -gt 0 ]; then _repo="$1"; fi fi + if [ -z "$(printf '%s' "$_body" | tr -d '[:space:]')" ]; then + echo "hive-forge comment-edit: refusing to post empty comment body" >&2; exit 1 + fi local _payload _payload=$(jq -n --arg body "$_body" '{body:$body}') forge_patch "$FORGE_API/repos/$_repo/issues/comments/$_id" "$_payload" \