Skip to content

chore(ci): make sponsor blurb append idempotent#627

Merged
jdx merged 1 commit into
mainfrom
fix/sponsor-strip-reappend
May 9, 2026
Merged

chore(ci): make sponsor blurb append idempotent#627
jdx merged 1 commit into
mainfrom
fix/sponsor-strip-reappend

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented May 9, 2026

Summary

The "Append en.dev sponsor blurb" step concatenates the GitHub release body with a heredoc'd canonical sponsor section unconditionally — there is no detection of an existing block.

mise v2026.5.4 just shipped two Sponsor mise sections after communique started inserting its own ## Sponsor mise block in the generated body. Fix: jdx/mise#9745; the release notes were edited by hand. usage uses the same append-without-detection pattern and would fail in the same way the next time communique decides to include a sponsor section.

Fix

Pipe the fetched body through a small awk filter that drops any ## .*Sponsor usage heading and everything after it, plus trailing blank lines, before appending the canonical block. Idempotent regardless of what's currently in the body. Matches the strip-and-reappend approach already used in hk, fnox, and communique.

Test plan

Simulated against three shapes — a body with no sponsor section (today's case), a body containing ## Sponsor usage from communique (the failure mode), and a body with trailing blank lines. Each produces exactly one ## 💚 Sponsor usage block with one blank line of separation. actionlint is clean on the modified workflow.

  • Next tagged release shows exactly one ## 💚 Sponsor usage section.

🤖 Generated with Claude Code


Note

Low Risk
Low risk CI-only change that affects GitHub release note formatting; primary risk is accidentally truncating release notes if the awk pattern matches unexpected headings.

Overview
Prevents duplicate sponsor sections in GitHub release notes by making the Append en.dev sponsor blurb step idempotent.

The workflow now filters the existing release body through an awk script that strips any prior ## .*Sponsor usage block (and trailing blank lines) before appending the canonical sponsor blurb and updating the release notes.

Reviewed by Cursor Bugbot for commit c884237. Bugbot is set up for automated code reviews on this repo. Configure here.

The "Append en.dev sponsor blurb" step concatenates the GitHub release
body with a heredoc'd canonical sponsor section unconditionally — no
detection of an existing block. mise v2026.5.4 just shipped two
"Sponsor mise" sections after communique started inserting its own
`## Sponsor mise` block; usage uses the same pattern and would fail in
the same way the next time communique decides to include a sponsor
section.

Pipe the fetched body through a small awk filter that drops any
`## .*Sponsor usage` heading and everything after it, plus trailing
blank lines, before appending the canonical block. Idempotent
regardless of what's currently in the body. Matches the strip-and-
reappend approach already used in hk, fnox, and communique.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@jdx jdx enabled auto-merge (squash) May 9, 2026 12:16
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 9, 2026

Greptile Summary

This PR adds an awk filter to the "Append en.dev sponsor blurb" CI step so the step is idempotent — it strips any pre-existing ## .*Sponsor usage heading and everything after it, plus trailing blank lines, before re-appending the canonical block. The change directly mirrors the fix applied to hk, fnox, and communique after the same pattern caused a duplicate sponsor section in a recent mise release.

  • The awk script correctly buffers blank lines and only flushes them before non-blank content, which strips trailing blanks without collapsing internal blank lines between sections.
  • The heading regex /^## .*Sponsor usage[[:space:]]*$/ is broad enough to match both the emoji variant (## 💚 Sponsor usage) and the plain variant inserted by communique, and [[:space:]]*$ guards against trailing whitespace on the matched line.
  • The heredoc begins with a blank line to guarantee one line of separation between the stripped body and the new sponsor block, even when the body ends on a non-blank line.

Confidence Score: 5/5

Safe to merge — the change is scoped to a single CI step with no impact on build artifacts or source code.

The awk filter is small and self-contained. Blank-line buffering is correct: internal blank lines are preserved and trailing ones are dropped. The regex matches both the communique-generated and canonical heading forms. The heredoc's leading blank line ensures proper separation even when the filtered body ends on a content line. No missing guards, no side effects outside the release-notes file, and the step already writes to a temp file before calling gh release edit, so partial failures leave the release unchanged.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/publish-cli.yml Adds an awk filter before the sponsor heredoc to strip any pre-existing ## .*Sponsor usage heading and trailing blank lines, making the append step idempotent.

Reviews (1): Last reviewed commit: "chore(ci): make sponsor blurb append ide..." | Re-trigger Greptile

@jdx jdx merged commit 386df55 into main May 9, 2026
9 checks passed
@jdx jdx deleted the fix/sponsor-strip-reappend branch May 9, 2026 12:17
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.94%. Comparing base (2f41056) to head (c884237).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #627   +/-   ##
=======================================
  Coverage   78.94%   78.94%           
=======================================
  Files          49       49           
  Lines        7284     7284           
  Branches     7284     7284           
=======================================
  Hits         5750     5750           
  Misses       1147     1147           
  Partials      387      387           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant