github action to run changie and generate changelog with automatic numbering
Go to file
2024-11-23 14:50:28 +01:00
.gitignore feature: create auto-changie to automatically generate changelog 2024-02-25 21:09:18 +01:00
action.yml chore(deps): update actions/setup-node action to v4.1.0 2024-11-22 21:18:10 +00:00
LICENSE Initial commit 2024-02-25 20:50:49 +01:00
README.md doc(readme): complete file_pattern in push changelog step 2024-11-23 14:50:28 +01:00
renovate.json Add renovate.json 2024-09-09 00:01:15 +00:00
script.sh fix: support initial commit in case of initialization from empty changelog list 2024-02-25 23:07:57 +01:00

auto-changie

Github action to run changie 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

name: Changelog generator

on:
  push:
    branches:
      - main
      - master

jobs:
  build:
    if: "contains(github.event.head_commit.message, vars.SKIP_CI_PREFIX) != true"
    steps:
      - uses: action/checkout@<latest_tag>
        with:
          fetch-depth: 0
          fetch-tags: false
          
      # ... do some CI habitual stuff
          
      - uses: https://antoine-roux.tk/projects/actions/auto-changie@<latest_tag>

      - name: Push changelog
        uses: stefanzweifel/git-auto-commit-action@<latest_tag>
        with:
          commit_message: "${{ vars.SKIP_CI_PREFIX }} Push updated changelog"
          file_pattern: "\\.changes/* CHANGELOG.md .changie.yaml"

This pipeline clone code update changelog with auto-changie and push it to main thanks to 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.