An open API service indexing awesome lists of open source software.

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

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 }}
```