From 052ff6ac20a7a4d56e41538c555ddc8e5196bfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Wed, 25 Mar 2026 00:32:22 +0100 Subject: [PATCH] Fix automerge: add workflow_run trigger after CI completes check_suite and status events don't reliably trigger for workflows on the same commit (GitHub prevents infinite loops). Replaced with workflow_run on CI completion, which fires after all CI jobs finish. Added comments explaining why each trigger group exists. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/automerge.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 54da42a..d4b88e1 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,5 +1,12 @@ name: Automerge +# Triggers: +# - pull_request: fires when PR is opened, labeled, updated, etc. +# Handles the case where the label is added after CI already passed. +# - workflow_run (CI): fires after the CI workflow completes. +# This is needed because check_suite and status events don't reliably +# fire for workflows on the same commit (GitHub prevents infinite loops). +# Without this, the automerge action never retries after CI passes. on: pull_request: types: @@ -14,10 +21,10 @@ on: pull_request_review: types: - submitted - check_suite: + workflow_run: + workflows: ["CI"] types: - completed - status: {} env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true