diff --git a/.codex/scripts/prerelease-notes.sh b/.codex/scripts/prerelease-notes.sh index 1acc09d..a327217 100644 --- a/.codex/scripts/prerelease-notes.sh +++ b/.codex/scripts/prerelease-notes.sh @@ -140,6 +140,11 @@ if [ -n "${GITHUB_REPOSITORY:-}" ] && [ "$RUN_ID" != "unknown" ]; then run_detail="[${RUN_ID}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${RUN_ID})" fi +handoff_heading="### Thunderstore handoff" +if [ -n "${GITHUB_REPOSITORY:-}" ] && [ "$COMMIT" != "unknown" ]; then + handoff_heading="

\"Thunderstore

" +fi + mkdir -p "$(dirname "$OUTPUT_PATH")" cat > "$OUTPUT_PATH" < "$OUTPUT_PATH" < [!NOTE] > This GitHub pre-release is the source artifact for the matching Thunderstore publish. Thunderstore receives package version \`${VERSION}\` from tag \`${TAG}\`. -### 📦 Thunderstore handoff +${handoff_heading} | Signal | Detail | | --- | --- | diff --git a/.codex/scripts/prerelease-notes.tests.ps1 b/.codex/scripts/prerelease-notes.tests.ps1 index 9d75f88..b63eb7c 100644 --- a/.codex/scripts/prerelease-notes.tests.ps1 +++ b/.codex/scripts/prerelease-notes.tests.ps1 @@ -41,7 +41,9 @@ function Invoke-PrereleaseNotes { function Test-PrereleaseNotesIncludesChangelogAndDetailsCard { $FixtureRoot = New-Fixture + $PreviousRepository = $env:GITHUB_REPOSITORY try { + $env:GITHUB_REPOSITORY = "mfoltz/Eclipse" $ChangelogPath = Join-Path $FixtureRoot "CHANGELOG.md" $OutputPath = Join-Path $FixtureRoot "prerelease-notes.md" Set-Content -Path $ChangelogPath -Value @' @@ -72,7 +74,11 @@ function Test-PrereleaseNotesIncludesChangelogAndDetailsCard { throw "Release notes should keep the Thunderstore handoff card visible without a dropdown." } - Assert-Match -Text $Notes -Pattern '### 📦 Thunderstore handoff' -Message "Release notes did not include the handoff card heading." + if ($Notes -match '### 📦 Thunderstore handoff') { + throw "Release notes should use the Thunderstore badge instead of the emoji heading." + } + + Assert-Match -Text $Notes -Pattern '