- Notifications
You must be signed in to change notification settings - Fork25
A GitHub Action to extract release notes from a "Keep a Changelog" formatted changelog file
License
ffurrer2/extract-release-notes
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
About
A GitHub Action to extract release notes from a "Keep a Changelog" formatted changelog file
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.