2024-02-25 19:50:49 +00:00
# auto-changie
2024-02-25 21:27:19 +00:00
Github action to run [changie ](https://changie.dev/ ) and generate changelog with automatic numbering
## How it works
These are the step done by this composite action :
- Setup node with `inputs.node-version`
- Setup changie cli through npm with `inputs.changie-version`
- Initialize changie subtree if not already exist (base on `.changie.yaml` existance)
- Retrieve all commit since last commit contained in last changie release version's file, or since beginning if not release have been done yet.
- Create a changie entry of type Changed for each commit of previous step
- Batch all change in a new automatic version
- Merge all version and update global `CHANGELOG.md` file
## Usage example
```yaml
name: Changelog generator
on:
push:
branches:
- main
- master
jobs:
build:
2024-09-08 20:12:08 +00:00
if: "contains(github.event.head_commit.message, vars.SKIP_CI_PREFIX) != true"
2024-02-25 21:27:19 +00:00
steps:
- uses: action/checkout@< latest_tag >
with:
fetch-depth: 0
fetch-tags: false
# ... do some CI habitual stuff
2024-09-08 20:12:08 +00:00
- uses: https://antoine-roux.tk/projects/actions/auto-changie@< latest_tag >
2024-02-25 21:27:19 +00:00
- name: Push changelog
uses: stefanzweifel/git-auto-commit-action@< latest_tag >
with:
2024-09-08 20:12:08 +00:00
commit_message: "${{ vars.SKIP_CI_PREFIX }} Push updated changelog"
2024-11-23 13:50:28 +00:00
file_pattern: "\\.changes/* CHANGELOG.md .changie.yaml"
2024-02-25 21:27:19 +00:00
```
This pipeline clone code update changelog with auto-changie and push it to main thanks to [git-auto-commit-action ](https://github.com/stefanzweifel/git-auto-commit-action ).
> Notice the use of `fetch-depth: 0` should be set.
2024-09-08 20:12:08 +00:00
> Indeed without this not all commit are retrieve and auto-changie fail to find all commit updated since previous run.