https://github.com/ultram4rine/extract-changes-action
Extract changes from keep a changelog for some version
https://github.com/ultram4rine/extract-changes-action
actions changelog keepachangelog
Last synced: 21 days ago
JSON representation
Extract changes from keep a changelog for some version
- Host: GitHub
- URL: https://github.com/ultram4rine/extract-changes-action
- Owner: ultram4rine
- License: mit
- Created: 2022-07-22T18:15:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T20:27:08.000Z (almost 2 years ago)
- Last Synced: 2026-03-04T18:58:53.421Z (4 months ago)
- Topics: actions, changelog, keepachangelog
- Language: JavaScript
- Homepage: https://github.com/marketplace/actions/extract-changes
- Size: 393 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# extract-changes-action
> Replacement of
>
> ```sh
> awk -v ver=$(grep 'version' package.json | awk -F: '{ print $2 }' | tr -d \ \",) '/^#+ \[/ { if (p) { exit }; if ($2 == "["ver"]") { p=1; next } } p && NF' CHANGELOG.md > changes.txt
> ```
Extract changes from [`keep a changelog`](https://keepachangelog.com/en/1.0.0/)
for some version. Companion for
[softprops/action-gh-release](https://github.com/softprops/action-gh-release).
## Inputs
### `changelog`
**Required** The name of the `changelog` file. Default `"CHANGELOG.md"`.
### `version`
**Required** The version for which you want to extract the changes.
### `output`
The name of the output file.
## Outputs
### `changes`
Changes of the specified version.
## Example usage
```yaml
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo VERSION=$(jq -r .version package.json) >> $GITHUB_OUTPUT
- name: Create release body
id: extract_changes
uses: ultram4rine/extract-changes-action@v2
with:
changelog: CHANGELOG.md
version: ${{ steps.get_version.outputs.VERSION }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.extract_changes.outputs.changes }}
```