From daf3ab4b778c381003f0c84f939cf78fb19090ff Mon Sep 17 00:00:00 2001 From: bbhtt Date: Wed, 24 Dec 2025 18:10:28 +0530 Subject: [PATCH] pr-check: Fix relabeling --- .github/workflows/pr-check.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 768f4e2..26e9cad 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -294,18 +294,16 @@ jobs: gh pr comment "$PR_NUM" --body "$LOCKED_COMMENT" || true gh pr lock "$PR_NUM" || true fi - if label_exists_any "awaiting-review"; then - echo "PR_THREAD_COUNT=$PR_THREAD_COUNT" - if [ "$PR_THREAD_COUNT" -gt 0 ]; then - echo "Has awaiting-review label and review comments, marking as awaiting-changes" - gh pr edit "$PR_NUM" \ - --add-label "awaiting-changes" \ - --remove-label "awaiting-review" || true - else - echo "No review comments, ensuring awaiting-review label" - gh pr edit "$PR_NUM" \ - --add-label "awaiting-review" \ - --remove-label "awaiting-changes" || true + if label_exists_any "awaiting-review" && [ "$PR_THREAD_COUNT" -gt 0 ]; then + echo "Has awaiting-review label and review comments, marking as awaiting-changes" + gh pr edit "$PR_NUM" \ + --add-label "awaiting-changes" \ + --remove-label "awaiting-review" || true + elif label_exists_any "awaiting-changes" && [ "$PR_THREAD_COUNT" -eq 0 ]; then + echo "No review comments, ensuring awaiting-review label" + gh pr edit "$PR_NUM" \ + --add-label "awaiting-review" \ + --remove-label "awaiting-changes" || true fi fi