From 0ccd8a7b154507a6f87944980bb177d62c68ea1f Mon Sep 17 00:00:00 2001 From: Neikon Date: Sun, 3 May 2026 14:28:15 +0000 Subject: [PATCH] fix: make submission issue closing idempotent --- .github/workflows/close-merged-theme-submission.yml | 7 +++++++ MEMORY.md | 1 + 2 files changed, 8 insertions(+) diff --git a/.github/workflows/close-merged-theme-submission.yml b/.github/workflows/close-merged-theme-submission.yml index c0b55624..db2f2111 100644 --- a/.github/workflows/close-merged-theme-submission.yml +++ b/.github/workflows/close-merged-theme-submission.yml @@ -27,5 +27,12 @@ jobs: exit 0 fi + issue_state="$(gh issue view "$issue_number" --json state --jq .state)" + + if [ "$issue_state" = "CLOSED" ]; then + echo "Source issue #${issue_number} is already closed." + exit 0 + fi + gh issue close "$issue_number" \ --comment "Theme submission was merged in #${PR_NUMBER}. Thanks for sharing it." diff --git a/MEMORY.md b/MEMORY.md index 1e1a6b5e..a594b271 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -45,6 +45,7 @@ This file stores durable project context so future conversations can resume work - Theme submission automation uses GitHub Issue Forms plus `.github/workflows/create-theme-submission.yml`; it creates candidate PRs from complete submission issues without Decap or external auth hosting - Approved submission PRs are finalized by `.github/workflows/publish-approved-theme-submission.yml`, which sets `status: "published"` and assigns the next available low `catalogIndex`; maintainers still merge the PR explicitly - Merged submission PRs close their source issue through `.github/workflows/close-merged-theme-submission.yml`; new generated PR bodies also include `Closes #` +- The close-merged submission workflow became idempotent on 2026-05-03: it now exits successfully when the source issue was already closed by GitHub's `Closes #` automation. - `.github/workflows/refresh-theme-stats.yml` runs monthly and opens a PR for changed repository stars, update dates, owner avatars, or accessibility values - The build workflow syntax also requires `workflow_dispatch:` with a trailing colon; missing it makes GitHub mark the workflow file as invalid even if other checks still pass