Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# vars.RELEASE=PRERELEASE (default) → tag/title {version}-preview, draft --prerelease.
# vars.RELEASE=STABLE → tag/title {version}, draft (not a prerelease). Never edits an existing preview.
# Org webhook publishes drafts.
# Notes copy cli/cli. Always append skip-announce and nosponsors so SponsorLink
# does not post them to X or inject a sponsors section.
name: release
on:
push:
Expand Down Expand Up @@ -43,7 +45,8 @@ jobs:
printf '%s\n' "$BODY"
echo ""
echo "https://github.com/cli/cli/releases/tag/v$VERSION"
echo "<!-- X -->"
echo '<!-- !x -->'
echo '<!-- nosponsors -->'
} > release-notes.md

if gh release view "$TAG" >/dev/null 2>&1; then
Expand Down
7 changes: 7 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ _Avoid_: submodule, clone, building `gh` from source
**Preview**:
A separate GitHub release tagged `{upstream}-preview` when `vars.RELEASE` is not `STABLE`. Nupkgs use that tag. A later STABLE release is `{upstream}`, not an edit of the preview.
_Avoid_: flipping the prerelease bit on a published release, `{version}-preview-preview`

**Skip-announce**:
`<!-- !x -->` in every GitHub release body. Notes are copied from cli/cli; SponsorLink must not post them to X.
_Avoid_: `<!-- X -->` (that *forces* an announcement)

**Nosponsors**:
`<!-- nosponsors -->` in every GitHub release body so SponsorLink does not inject a sponsors section.
5 changes: 5 additions & 0 deletions docs/adr/0004-never-announce-releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GHX releases are never announced

SponsorLink's org webhook posts a published GitHub release to X when the body matches changelog section titles or contains `<!-- x -->`, and injects a sponsors section unless the body contains `<!-- nosponsors -->`. GHX notes are the upstream GitHub CLI changelog.

Every draft from `release.yml` appends `<!-- !x -->` (skip-announce) and `<!-- nosponsors -->`. `<!-- x -->` must not appear: that marker forces an announcement.
15 changes: 15 additions & 0 deletions src/Tests/ReleaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ public void Non_stable_release_is_named_version_preview_not_an_edit()
Assert.DoesNotContain("--prerelease=false", release);
}

[Fact]
public void Release_notes_skip_sponsorlink_announcement_and_sponsors()
{
var release = File.ReadAllText(Path.Combine(FindRepoRoot(), ".github", "workflows", "release.yml"));
// SponsorLink posts published releases to X unless the body contains skip-announce,
// and injects a sponsors section unless it contains nosponsors.
// GHX notes are copied from cli/cli; they are not our work. <!-- X --> *forces* a post.
Assert.Contains("echo '<!-- !x -->'", release);
Assert.Contains("echo '<!-- nosponsors -->'", release);
Assert.DoesNotContain("echo \"<!-- X -->\"", release);
Assert.DoesNotContain("echo \"<!-- x -->\"", release);
Assert.DoesNotContain("echo '<!-- X -->'", release);
Assert.DoesNotContain("echo '<!-- x -->'", release);
}

[Fact]
public void Publish_version_does_not_double_append_preview()
{
Expand Down
Loading