feat: Add changelog.yml for changelog generation
This commit is contained in:
41
.github/workflows/changelog.yml
vendored
Normal file
41
.github/workflows/changelog.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Generate changelog
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
generate-changelog:
|
||||
name: Generate changelog
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
release_body: ${{ steps.release.outputs.release_body }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Generate a changelog
|
||||
uses: orhun/git-cliff-action@v1
|
||||
id: git-cliff
|
||||
with:
|
||||
config: config/cliff.toml
|
||||
args: -vv --latest --strip header
|
||||
env:
|
||||
OUTPUT: CHANGES.md
|
||||
- name: Set the release body
|
||||
id: release
|
||||
shell: bash
|
||||
run: |
|
||||
r=$(cat ${{ steps.git-cliff.outputs.changelog }})
|
||||
r="$(printf "$r" | tail -n +3)"
|
||||
r="${r//'%'/'%25'}"
|
||||
r="${r//$'\n'/'%0A'}"
|
||||
r="${r//$'\r'/'%0D'}"
|
||||
echo "::set-output name=release_body::$r"
|
||||
Reference in New Issue
Block a user