From 24d0c08610b4ee24e3e2e0e2c7fb3e5826ef96eb Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sun, 25 Feb 2024 22:27:19 +0100 Subject: [PATCH] docs: complete README with explanation about action usage --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d22bbf5..88d7ef0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,51 @@ # auto-changie -github action to run changie and generate changelog with automatic numbering + +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: + if: "contains(github.event.head_commit.message, 'CI') != true" + steps: + - uses: action/checkout@ + with: + fetch-depth: 0 + fetch-tags: false + + # ... do some CI habitual stuff + + - uses: RouxAntoine/auto-changie@ + + - name: Push changelog + uses: stefanzweifel/git-auto-commit-action@ + with: + commit_message: "CI: Push updated changelog" +``` + +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. +> Indeed without this not all commit are retrieve and auto-changie fail to find all commit updated since previous run. \ No newline at end of file