Skip to content

Commit 9a095e7

Browse files
committed
Use GitHub generate-notes API for changelog
Produces the standard GitHub release notes format with PR links, clean titles, and New Contributors section automatically.
1 parent 7f3b286 commit 9a095e7

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ jobs:
6262
echo "- ${{ steps.build_info.outputs.swift_version }}"
6363
echo ""
6464
65-
# What's Changed section
66-
echo "## What's Changed"
65+
# What's Changed section (auto-generated by GitHub)
6766
if [ -n "$PREV_TAG" ]; then
68-
gh api "repos/${REPO}/compare/${PREV_TAG}...${TAG_NAME}" --paginate \
69-
--jq '.commits[] | select(.parents | length == 1) | "* \(.commit.message | split("\n")[0]) by @\(if .author then .author.login else .commit.author.name end) in \(.html_url)"'
70-
echo ""
71-
echo "**Full Changelog**: ${GITHUB_SERVER_URL}/${REPO}/compare/${PREV_TAG}...${TAG_NAME}"
67+
gh api "repos/${REPO}/releases/generate-notes" \
68+
-f tag_name="${TAG_NAME}" \
69+
-f previous_tag_name="${PREV_TAG}" \
70+
--jq '.body'
7271
else
73-
gh api "repos/${REPO}/commits" --paginate \
74-
--jq '.[] | select(.parents | length <= 1) | "* \(.commit.message | split("\n")[0]) by @\(if .author then .author.login else .commit.author.name end) in \(.html_url)"'
72+
gh api "repos/${REPO}/releases/generate-notes" \
73+
-f tag_name="${TAG_NAME}" \
74+
--jq '.body'
7575
fi
7676
} > release_notes.md
7777
- name: Create Release

0 commit comments

Comments
 (0)