Extract Release Notes
ActionsTags
(2)This GitHub Action extracts release notes from aKeep a Changelog formatted changelog file.
- Create a
CHANGELOG.mdfile based on the changelog format of theKeep a Changelog project. - Create a workflow
.ymlfile in your.github/workflowsdirectory. Anexample workflow is available below. For more information, reference the GitHub Help Documentation forCreating a workflow file.
| Input | Description |
|---|---|
changelog_file(optional) | The input path of the changelog file. Default:CHANGELOG.md |
release_notes_file(optional) | The output path of the (optional) release notes file. |
| Output | Description |
|---|---|
release_notes | The escaped release notes. |
On everypush to a tag matching the pattern*.*.*, extract the release notes from theCHANGELOG.md file andcreate a release:
name:Create Releaseon:push:tags: -'*.*.*'jobs:release:name:Create releaseruns-on:ubuntu-latestpermissions:contents:writesteps: -name:Checkoutuses:actions/checkout@v4 -name:Extract release notesid:extract-release-notesuses:ffurrer2/extract-release-notes@v2 -name:Create releaseenv:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}run:gh release create ${{ github.ref_name }} --notes '${{ steps.extract-release-notes.outputs.release_notes }}'
This code will extract the content between the second and third H2 header from theCHANGELOG.md file, store this content in the output variablerelease_notes and create a release using thegh release create command.
jobs:release:runs-on:ubuntu-lateststeps: -name:Checkoutuses:actions/checkout@v4 -name:Extract release notesid:extract-release-notesuses:ffurrer2/extract-release-notes@v2with:changelog_file:MY_CHANGELOG.md
jobs:release:runs-on:ubuntu-lateststeps: -name:Checkoutuses:actions/checkout@v4 -name:Extract release notesuses:ffurrer2/extract-release-notes@v2with:release_notes_file:RELEASE_NOTES.md
To extract the content between the first (## [Unreleased]) and second H2 header, set theprerelease parameter totrue.
jobs:release:runs-on:ubuntu-lateststeps: -name:Checkoutuses:actions/checkout@v4 -name:Extract release notesuses:ffurrer2/extract-release-notes@v2with:prerelease:true
This project is licensed under theMIT License.
Extract Release Notes is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.
Tags
(2)Extract Release Notes is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.