diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..dc1c417 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,27 @@ +name: Changelog + +on: + release: + types: [published] + +jobs: + worker: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - name: Set up git-cliff + uses: kenji-miyake/setup-git-cliff@v1 + + - name: Generate Changelog + run: git cliff -v -o CHANGELOG.md -c cliff.toml + + - name: Update Changelog + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: 'chore: Update Changelog.' \ No newline at end of file diff --git a/cliff.toml b/cliff.toml index 2025a9b..fffb70f 100644 --- a/cliff.toml +++ b/cliff.toml @@ -17,7 +17,7 @@ body = """ {% for group, commits in commits | group_by(attribute="group") %} ### {{ group | upper_first }} {% for commit in commits %} - - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ + - {% if commit.breaking %}[**breaking**] {% endif %}[{{ commit.message | upper_first }}](https://github.com/fourjuaneight/media/commit/{{ commit.id }})\ {% endfor %} {% endfor %}\n """