From f52f626b0e0cfc9a24bf6999640ae7940a757c5b Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:41:30 +0200 Subject: [PATCH] feat: Add changelog.yml for changelog generation --- .github/workflows/changelog.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..f1562e54 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -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"