From 4ab69ce355e3d6c9f968ce89b61574b8a079eb77 Mon Sep 17 00:00:00 2001 From: Max Haarhaus Date: Mon, 10 Aug 2026 02:09:16 -0400 Subject: [PATCH] chore(ci): update release pr notes template --- .github/workflows/release-pr.yml | 17 ++++++++++++++++- .github/workflows/release.yml | 2 +- tests/release-workflows.test.ts | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 tests/release-workflows.test.ts diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index b5804fc0..f0edbcc8 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -57,9 +57,24 @@ jobs: PR_BODY_FILE=$(mktemp) cat > "$PR_BODY_FILE" <<'EOF' + ## Release notes - _Replace this paragraph with a short narrative for the release. If left unchanged, GitHub's auto-generated notes will be used instead._ + ### Highlights + + + + ### Behavior changes to know about + + + + ### Fixes + + + + ### Internal changes + + EOF PR_URL=$(gh pr create \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c829f67b..50ee0682 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: --json body \ --jq '.[0].body // ""') - if [ -n "$PR_BODY" ] && ! echo "$PR_BODY" | grep -q "Replace this paragraph"; then + if [ -n "$PR_BODY" ] && ! echo "$PR_BODY" | grep -q "release-notes:todo"; then echo "Using release PR body for notes." printf '%s\n' "$PR_BODY" > /tmp/release-notes.md else diff --git a/tests/release-workflows.test.ts b/tests/release-workflows.test.ts new file mode 100644 index 00000000..1297c579 --- /dev/null +++ b/tests/release-workflows.test.ts @@ -0,0 +1,32 @@ +import { describe, expect, test } from "bun:test"; +import fs from "node:fs"; +import path from "node:path"; + +const REPO_ROOT = path.resolve(import.meta.dir, ".."); + +describe("release notes workflow contract", () => { + const releasePrWorkflow = fs.readFileSync( + path.join(REPO_ROOT, ".github/workflows/release-pr.yml"), + "utf8", + ); + const releaseWorkflow = fs.readFileSync( + path.join(REPO_ROOT, ".github/workflows/release.yml"), + "utf8", + ); + + test("release PRs start with the structured notes skeleton", () => { + expect(releasePrWorkflow).toContain(""); + expect(releasePrWorkflow).toContain("