From 90310f75bbe107479e44c950b77fda187b2c56b3 Mon Sep 17 00:00:00 2001 From: Robert Kirkman Date: Sun, 9 Nov 2025 02:46:05 -0600 Subject: [PATCH] feat(ci): Automatically close old "Repository Health Check Failed" issues before opening new ones --- .github/workflows/check_repository_health.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/check_repository_health.yml b/.github/workflows/check_repository_health.yml index 637ce18a833b22..1d6eb1c70ade2a 100644 --- a/.github/workflows/check_repository_health.yml +++ b/.github/workflows/check_repository_health.yml @@ -34,4 +34,19 @@ jobs: run: | ISSUE_TITLE="Repository Health Check Failed" ISSUE_BODY=$(cat repository-health.txt) + # if any previous Repository Health Check Failed issues are open, close them first + local number + while read -r number; do + echo "INFO: Closing issue number: $number" + sleep 5 + gh issue close "$number" --reason completed + sleep 5 + done < <( + gh issue list \ + --limit 99999 \ + --label "health-check" \ + --state open \ + --search "$ISSUE_TITLE in:title type:issue" \ + --json number | jq -r '.[] | .number' + ) gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --label "health-check" --assignee "thunder-coding"