diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d47d2c6..f9c575e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,10 @@ # Creates a draft GitHub release when azure-cli.version changes. # 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. +# Org webhook publishes drafts. Always append and +# so SponsorLink does not post to X or inject a sponsors section: the notes are +# Upstream Azure CLI notes, not ours. is the opposite (force-announce) +# and must not appear. name: release on: push: @@ -43,7 +46,8 @@ jobs: printf '%s\n' "$BODY" echo "" echo "https://github.com/Azure/azure-cli/releases/tag/azure-cli-$VERSION" - echo "" + echo "" + echo "" } > release-notes.md if gh release view "$TAG" >/dev/null 2>&1; then diff --git a/docs/adr/0004-releases-skip-x-announcements.md b/docs/adr/0004-releases-skip-x-announcements.md new file mode 100644 index 0000000..af26855 --- /dev/null +++ b/docs/adr/0004-releases-skip-x-announcements.md @@ -0,0 +1,3 @@ +# Releases skip SponsorLink announcements and sponsor injection + +Draft notes copy the Upstream Azure CLI release body. SponsorLink's org webhook posts a published release to X unless the body contains ``, and injects a sponsors section unless it contains ``. We always append both: the notes are Azure's work, not ours. `` is the opposite (force-announce) and must not appear. diff --git a/src/Tests/ReleaseTests.cs b/src/Tests/ReleaseTests.cs index 73c44a2..84c8198 100644 --- a/src/Tests/ReleaseTests.cs +++ b/src/Tests/ReleaseTests.cs @@ -16,6 +16,15 @@ public void Non_stable_release_is_named_version_preview_not_an_edit() Assert.DoesNotContain("--prerelease=false", release); } + [Fact] + public void Draft_notes_opt_out_of_sponsorlink_side_effects() + { + var release = File.ReadAllText(Path.Combine(FindRepoRoot(), ".github", "workflows", "release.yml")); + Assert.Contains("echo \"\"", release); + Assert.DoesNotContain("echo \"\"", release); + Assert.Contains("echo \"\"", release); + } + [Fact] public void Publish_version_does_not_double_append_preview() {