Skip to content

Commit 0e1587b

Browse files
authored
Merge pull request #11 from kjanat/chore/release-notes-from-tag
Release with the tag's own message
2 parents 48658ca + a37153c commit 0e1587b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
permissions: { contents: write, id-token: write, attestations: write }
3232
steps:
3333
- uses: actions/checkout@v7
34+
- name: Release notes from the tag message
35+
run: |
36+
git fetch --force origin "refs/tags/${GITHUB_REF_NAME}:refs/tags/${GITHUB_REF_NAME}"
37+
git tag -l --format='%(contents:body)' "${GITHUB_REF_NAME}" > "${RUNNER_TEMP}/notes.md"
38+
test -s "${RUNNER_TEMP}/notes.md" || {
39+
echo "tag ${GITHUB_REF_NAME} carries no message body to release with" >&2
40+
exit 1
41+
}
3442
- uses: actions/download-artifact@v8
3543
with: { path: dist, merge-multiple: true }
3644
- name: Checksums
@@ -43,5 +51,6 @@ jobs:
4351
with:
4452
working_directory: dist
4553
files: "envctl-*\nSHA256SUMS"
54+
body_path: ${{ runner.temp }}/notes.md
4655
generate_release_notes: true
4756
fail_on_unmatched_files: true

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ git tag -s v0.2.0 -m "v0.2.0"
141141
git push origin v0.2.0
142142
```
143143

144+
The tag's message body becomes the release notes, with the generated commit list
145+
appended below it, so write the tag for a reader who was not here. The first
146+
line is the version alone; everything after the blank line is published. An
147+
empty body fails the release job rather than shipping a bare commit list.
148+
144149
[`.dprint.jsonc`]: .dprint.jsonc
145150
[`.clang-format`]: .clang-format
146151
[`tests/run.sh`]: tests/run.sh

0 commit comments

Comments
 (0)