Skip to content
Merged
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
24 changes: 23 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ jobs:
run:
shell: bash
steps:
# Checked out before the download, so the checkout's clean can't touch dist/.
# Only CHANGELOG.md is read, and nothing here pushes, so the token stays out.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: terminus-*
Expand All @@ -236,6 +242,22 @@ jobs:
exit 1
fi

# The release notes are this version's CHANGELOG section, minus the link
# block at the foot. A tag with no section gets no draft.
- name: Slice the CHANGELOG section for this version
run: |
set -euo pipefail
ver="${GITHUB_REF_NAME#v}"
awk -v ver="$ver" '
$0 ~ "^## \\[" ver "\\]" { f = 1; next }
f && /^## \[/ { exit }
f && !/^\[[^]]+\]: *http/ { print }
' CHANGELOG.md > RELEASE_NOTES.md
if [ ! -s RELEASE_NOTES.md ]; then
echo "::error::CHANGELOG.md has no section for ${ver}"
exit 1
fi

# A draft, never a prerelease: releases/latest skips prereleases, and
# that is where install.sh looks once the owner publishes.
- name: Create the draft
Expand All @@ -247,4 +269,4 @@ jobs:
--draft --verify-tag \
--repo "$GITHUB_REPOSITORY" \
--title "$GITHUB_REF_NAME" \
--notes ""
--notes-file RELEASE_NOTES.md
Loading