From e9bed07948b41f960c74cebabd30f08984674005 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sun, 26 Apr 2026 18:10:36 -0500 Subject: [PATCH] ci(release): dedupe sponsor section in release notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Append en.dev sponsor blurb` step was not idempotent. Under communique 1.1.x, the LLM reproduces a `## Sponsor hk` section from the previous release's body into the new body, and the workflow would then append a second `## 💚 Sponsor hk` block on top — visible in v1.44.2. Strip any existing `## …Sponsor hk` heading (and everything after it) from the live release body before appending the canonical blurb. Mirrors jdx/communique#123. The regex matches both the no-emoji form (which communique generates because of `[defaults] emoji = false`) and the emoji form, so the step is self-healing on reruns. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57e834dc4..56befefdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -181,15 +181,16 @@ jobs: else TAG_NAME="${{ github.ref_name }}" fi - { - gh release view "$TAG_NAME" --json body --jq .body - cat <<'EOF' - + gh release view "$TAG_NAME" --json body --jq .body \ + | perl -0pe 's/\n*^##[^\n]*Sponsor hk\b.*\z//ms' \ + > /tmp/release-notes.md + printf '\n\n' >> /tmp/release-notes.md + cat <<'EOF' >> /tmp/release-notes.md ## 💚 Sponsor hk hk is developed by [@jdx](https://github.com/jdx) at [**en.dev**](https://en.dev) — a small independent studio behind developer tools like [mise](https://mise.jdx.dev/), [aube](https://aube.en.dev/), hk, and more. Work on hk is funded by sponsorships. If hk has sped up your pre-commit loop or made linting feel less painful, please consider [sponsoring at en.dev](https://en.dev). Sponsorships are what keep hk moving and the project independent. EOF - } > /tmp/release-notes.md + gh release edit "$TAG_NAME" --notes-file /tmp/release-notes.md