From ed9e946cd1809794ec62c7152079c2d0ddb4026c Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Wed, 15 Jul 2026 23:00:09 -0400 Subject: [PATCH] fix: handle Gitea 1.27's workflow_call event name in the trigger gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gitea 1.27 (breaking change go-gitea#37478) runs a called (reusable) workflow with github.event_name = 'workflow_call' instead of propagating the caller's event. Every consumer stub forwards EVENT_NAME from github.event_name, so since the server upgrade every review arrived as an unhandled event and self-skipped in one second while reporting success — mort PRs #1445-#1447 all went unreviewed. Reclassify workflow_call from the forwarded payload: a non-empty COMMENT_BODY can only come from issue_comment (trigger-phrase + actor gates still apply); otherwise a PR number means a pull_request-shaped trigger. Neither → the existing unhandled-event skip. Pre-1.27 servers are unaffected. Co-Authored-By: Claude Fable 5 --- entrypoint.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 034f38f..050333b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -110,6 +110,26 @@ actor_allowed() { } # --- trigger gating -------------------------------------------------------- +# Gitea >= 1.27 (breaking change go-gitea#37478, "improve support for reusable +# workflows") runs a CALLED workflow with github.event_name = 'workflow_call' +# instead of propagating the caller's event, so every consumer stub's trigger +# arrived here as an unhandled event and the review silently self-skipped +# (observed 2026-07-14: mort PRs #1445-#1447 got 1-second "success" runs). +# Reclassify from the forwarded event payload: a comment body can only come +# from issue_comment (its trigger-phrase + actor gates still apply below); +# otherwise a PR number means a pull_request-shaped trigger (this also covers +# dispatch-through-reusable, whose pr_number input populates PR — the draft +# check degrades safely since IS_DRAFT defaults false). Neither → fall through +# to the unhandled-event skip. Pre-1.27 servers still send the caller's event +# name and never enter this branch. +if [ "${EVENT_NAME:-}" = "workflow_call" ]; then + if [ -n "${COMMENT_BODY:-}" ]; then + EVENT_NAME="issue_comment" + elif [ -n "${PR:-}" ]; then + EVENT_NAME="pull_request" + fi + log "caller event arrived as 'workflow_call'; reclassified to '${EVENT_NAME}'" +fi case "$EVENT_NAME" in workflow_dispatch) log "manual dispatch for PR #${PR}" ;;