From a96db38b86cec14455e99d0c9eb4ffe27ef7e9b4 Mon Sep 17 00:00:00 2001 From: nandi <78769380+codegod100@users.noreply.github.com> Date: Sat, 8 Aug 2026 12:41:26 -0700 Subject: [PATCH] Parse native Garden webhook fields in webhook-to-boxci.sh. Support after/repository.id payloads and ignore patch/delete events when Garden pipes broker JSON through the script instead of posting to boxci directly. Co-authored-by: Cursor --- scripts/boxci/webhook-to-boxci.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/boxci/webhook-to-boxci.sh b/scripts/boxci/webhook-to-boxci.sh index bf098f4..6c56f43 100755 --- a/scripts/boxci/webhook-to-boxci.sh +++ b/scripts/boxci/webhook-to-boxci.sh @@ -19,11 +19,16 @@ bk_require_cmd jq bk_require_cmd curl payload="$(cat)" -commit="$(echo "$payload" | jq -r '.commit // .Commit // .head // empty')" -repo="$(echo "$payload" | jq -r '.repo // .repository // .repo_id // empty')" -branch="$(echo "$payload" | jq -r '.branch // .ref // .refs/heads // empty' | sed 's|^refs/heads/||')" +commit="$(echo "$payload" | jq -r '.commit // .Commit // .head // .after // empty')" +repo="$(echo "$payload" | jq -r '.repo // .repo_id // .repository.id // empty')" +branch="$(echo "$payload" | jq -r '.branch // .ref // .refs/heads // .repository.default_branch // empty' | sed 's|^refs/heads/||; s|.*/refs/heads/||')" if [[ -z "$commit" ]]; then + # Patch / branch-delete Garden events — boxci ignores these too. + if echo "$payload" | jq -e '.patch // .deleted // empty' >/dev/null 2>&1; then + echo "webhook-to-boxci: patch/delete event — ignoring" >&2 + exit 0 + fi echo "webhook-to-boxci: no commit in payload — ignoring" >&2 exit 0 fi -- 2.51.2