From 5eee03ab9294e3761f838b286f0c6998c56ad9fb Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 21 Oct 2025 15:02:17 +0200 Subject: [PATCH] Prevent recursive commits (#576) Signed-off-by: Glenn Jocher --- action.yml | 6 ++++++ actions/review_pr.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index d90ec21..5e2ac23 100644 --- a/action.yml +++ b/action.yml @@ -232,6 +232,12 @@ runs: GITHUB_USERNAME: ${{ inputs.github_username }} GITHUB_EMAIL: ${{ inputs.github_email }} run: | + # Check if last commit was by the bot to prevent recursive loops + LAST_AUTHOR=$(git log -1 --pretty=format:'%an') + if [ "$LAST_AUTHOR" = "$GITHUB_USERNAME" ]; then + echo "Last commit was by $GITHUB_USERNAME, skipping to prevent recursive loop" + exit 0 + fi git config --global user.name "$GITHUB_USERNAME" git config --global user.email "$GITHUB_EMAIL" git add . diff --git a/actions/review_pr.py b/actions/review_pr.py index a0d80ef..fd913bc 100644 --- a/actions/review_pr.py +++ b/actions/review_pr.py @@ -231,8 +231,8 @@ def post_review_summary(event: Action, review_data: dict, review_number: int) -> "please", "should", "must", - "need to", - "needs to", + "raise", + "needs", "before merging", "fix", "error",