Skip to content

feat: include changelog release notes in GitHub releases#22768

Open
workharsh99 wants to merge 1 commit into
vitejs:mainfrom
workharsh99:feature/include-release-notes
Open

feat: include changelog release notes in GitHub releases#22768
workharsh99 wants to merge 1 commit into
vitejs:mainfrom
workharsh99:feature/include-release-notes

Conversation

@workharsh99

Copy link
Copy Markdown

Description

Currently, Vite release notes on GitHub only contain a link directing users to the CHANGELOG.md file. Other repositories in the organization (such as Vitest, Rolldown, Oxc) include the actual notes in the release itself, which is much better for tools like Dependabot and general readability.

This PR updates the release workflow to extract the specific section of the release notes from the package's CHANGELOG.md file and populate the GitHub Release body directly.


Changes

  1. Created scripts/extractReleaseNotes.js:

    • Parses the package name and tag/version name.
    • Reads the target package's CHANGELOG.md and extracts the release section matching the version.
    • Automatically rewrites relative markdown links and image paths (e.g. ../../docs/public/...) to absolute URLs pointing to the repository tag so they render correctly on GitHub releases.
    • Includes a robust fallback mechanism that defaults to the standard changelog link if parsing fails.
  2. Modified .github/workflows/release-tag.yml:

    • Added an Extract Release Notes step before creating the release tag.
    • Switched the yyx990803/release-tag action input from body to body_path referencing the generated .github/release-notes.md.

Verification & Testing

  • Verified locally by running the extraction script against tag v8.1.0 and confirming correct formatting.
  • Verified against the major v8.0.0 tag, confirming that the relative announcement image path ../../docs/public/og-image-announcing-vite8.webp was successfully rewritten to:
    https://github.com/vitejs/vite/blob/v8.0.0/docs/public/og-image-announcing-vite8.webp

- name: Extract Release Notes
if: steps.tag.outputs.pkgName
run: |
node scripts/extractReleaseNotes.js ${{ steps.tag.outputs.pkgName }} ${{ github.ref_name }} .github/release-notes.md
- name: Extract Release Notes
if: steps.tag.outputs.pkgName
run: |
node scripts/extractReleaseNotes.js ${{ steps.tag.outputs.pkgName }} ${{ github.ref_name }} .github/release-notes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants