Skip to content

chore(ci): make sponsor blurb append idempotent regardless of input#551

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

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

Conversation

@jdx

@jdx jdx commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

#488 added a grep -Fqx '## 💚 Sponsor aube' exact-line check that skips the append when the canonical heading is already present. That handles re-runs of this workflow, but not the failure mode that just bit mise:

  • mise v2026.5.4 shipped two Sponsor mise sections — communique started including its own ## Sponsor mise (no heart emoji) in the generated body, the equivalent exact-match check in mise missed it, and the workflow appended the canonical block on top. Fixed in jdx/mise#9745 and the v2026.5.4 release notes were edited by hand.

The same drift can happen here. aube's check is grep -Fqx '## 💚 Sponsor aube' (fixed-string, full-line), so a ## Sponsor aube heading from communique would not match → duplicate block.

Fix

Switch to a strip-and-reappend pattern (matches what the same step in hk, fnox, and communique already do): pipe the body through a tiny awk filter that drops any ## .*Sponsor aube heading and everything after it, plus trailing blank lines, then append the canonical block.

Idempotent regardless of whether the body already contains a sponsor section, in which variant, or none at all.

Test plan

Simulated locally against four shapes — the existing canonical body (re-run case), a body containing ## Sponsor aube (no emoji, the failure mode), a body with no sponsor section at all, and a body with trailing blank lines. Each produces exactly one ## 💚 Sponsor aube block with one blank line of separation. actionlint is clean on the modified workflow.

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

🤖 Generated with Claude Code


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Note

Low Risk
Low risk CI-only change, but it alters release-note editing logic and could affect the final GitHub release body formatting if the awk trimming behaves unexpectedly.

Overview
Updates the release-plz workflow’s “Append en.dev sponsor blurb” step to be fully idempotent by stripping any existing Sponsor aube section (emoji or non-emoji heading) and trailing blank lines before re-appending the canonical sponsor block.

This replaces the prior exact-line grep check so re-runs or communique-generated sponsor headings no longer produce duplicate sponsor sections in GitHub release notes.

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

#488 added a `grep -Fqx '## 💚 Sponsor aube'` exact-line check that
skips the append when the canonical heading is already present. That
handles re-runs of this workflow, but not the failure mode that just
shipped two sponsor blocks in mise v2026.5.4: communique started
including its own `## Sponsor aube` section (no heart emoji) in the
generated body, the exact-match check missed it, and the workflow
appended the canonical block on top.

Switch to a strip-and-reappend pattern (matches what the same step in
hk, fnox, and communique already do): pipe the body through a tiny awk
filter that drops any `## .*Sponsor aube` heading and everything after
it, plus trailing blanks, then append the canonical block. Idempotent
regardless of whether the body already contains a sponsor section, in
which variant, or none at all.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx enabled auto-merge (squash) May 9, 2026 12:16
@greptile-apps

greptile-apps Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Replaces the previous grep -Fqx early-exit guard in the "Append en.dev sponsor blurb" step with an awk strip-and-reappend pattern, closing the gap where a ## Sponsor aube heading emitted by communique (without the heart emoji) would bypass the old exact-match check and cause a duplicate sponsor block.

  • The new awk filter scans the fetched release body, exits as soon as it encounters any line matching ^## .*Sponsor aube, and buffers blank lines so they are only flushed when a non-blank line follows — silently dropping trailing whitespace before the sponsor section.
  • The filtered body (trimmed) is then prefixed to the canonical heredoc block and written to the release notes, producing exactly one ## 💚 Sponsor aube section on every run regardless of prior state.

Confidence Score: 5/5

Safe to merge — the change is a targeted, well-scoped replacement of a single workflow step with no functional side-effects on other jobs.

The awk logic is correct: blank-line buffering properly suppresses trailing whitespace, the pattern ^## .*Sponsor aube[[:space:]]*$ matches both the emoji and no-emoji variants, and the exit correctly truncates everything from the first match onward. Command-substitution stripping of trailing newlines is accounted for. The strip-and-reappend approach is already proven in sibling projects (hk, fnox, communique). No credentials, secrets, or external service calls are modified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/release-plz.yml Replaces an exact-match grep guard with an awk strip-and-reappend pattern, making the sponsor-blurb append idempotent against both the canonical heading and the no-emoji variant that communique can emit.

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

@jdx jdx merged commit cf5499b into main May 9, 2026
20 checks passed
@jdx jdx deleted the fix/sponsor-strip-reappend branch May 9, 2026 12:22
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