From 71580602c1a9e5d1e451853179a8d01cdb2431ff Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 23 May 2026 17:41:59 +0300 Subject: ci: mark closed referenced issues pending release --- .github/workflows/label-next-release-issues.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/label-next-release-issues.yml b/.github/workflows/label-next-release-issues.yml index f1e2074e..02e947d1 100644 --- a/.github/workflows/label-next-release-issues.yml +++ b/.github/workflows/label-next-release-issues.yml @@ -88,10 +88,7 @@ jobs: continue fi - if [ "$(jq -r '.state' <<<"$data")" != "open" ]; then - echo "Skipping #$issue because it is not open." - continue - fi + ISSUE_STATE="$(jq -r '.state' <<<"$data")" HAS_NEXT_RELEASE_LABEL="$(jq -r --arg label "$NEXT_RELEASE_LABEL" 'any(.labels[].name; . == $label)' <<<"$data")" if [ "$HAS_NEXT_RELEASE_LABEL" != "true" ]; then @@ -111,13 +108,22 @@ jobs: HAS_PENDING_COMMENT="true" fi - if [ "$HAS_PENDING_COMMENT" = "true" ]; then - if ! gh issue close "$issue" --repo "$GITHUB_REPOSITORY" --reason completed; then + if [ "$ISSUE_STATE" = "open" ]; then + if [ "$HAS_PENDING_COMMENT" = "true" ]; then + if ! gh issue close "$issue" --repo "$GITHUB_REPOSITORY" --reason completed; then + echo "::warning::Could not close issue #$issue." + continue + fi + elif ! gh issue close "$issue" --repo "$GITHUB_REPOSITORY" --reason completed --comment "$PENDING_COMMENT"; then echo "::warning::Could not close issue #$issue." continue fi - elif ! gh issue close "$issue" --repo "$GITHUB_REPOSITORY" --reason completed --comment "$PENDING_COMMENT"; then - echo "::warning::Could not close issue #$issue." - continue + elif [ "$HAS_PENDING_COMMENT" != "true" ]; then + if ! gh issue comment "$issue" --repo "$GITHUB_REPOSITORY" --body "$PENDING_COMMENT"; then + echo "::warning::Could not comment on closed issue #$issue." + continue + fi + else + echo "Skipping pending-release comment for #$issue because it already exists." fi done -- cgit v1.2.3