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}" ;;