From 1e1e7a9e9dc054bb17026ba53138bccec78113aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Vescera?= Date: Tue, 1 Aug 2023 14:30:15 +0200 Subject: [PATCH 1/2] fix: generazione changelog Migliorato il file di configurazione per la generazione dei changelo per le Releae: ora viene aggiunto il tag all'autore del commit. Sistemato un problema che mostrava tutto il corpo dei commit nella sezione 'Commits'. --- .github/workflows/autorelease.yml | 24 +++++++++++++++--------- .github/workflows/configs/conf.toml | 9 +++++---- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/autorelease.yml b/.github/workflows/autorelease.yml index 4a2b9938e..9346e9a91 100644 --- a/.github/workflows/autorelease.yml +++ b/.github/workflows/autorelease.yml @@ -32,17 +32,23 @@ jobs: with: fetch-depth: 0 - - name: Generate changelog - uses: orhun/git-cliff-action@v2 - id: git-cliff - with: - config: .github/workflows/configs/conf.toml - args: -vv --latest --unreleased --strip header --tag v${{needs.tag.outputs.newtag}} + - name: Install jq + run: sudo apt-get install -y jq + + - name: Install git-cliff 🏔 + run: | + export version=1.2.0 + wget "https://github.com/orhun/git-cliff/releases/download/v${version}/git-cliff-${version}-x86_64-unknown-linux-gnu.tar.gz" + tar -xvzf git-cliff-*.tar.gz + cp "git-cliff-${version}/git-cliff" /usr/local/bin/ + + - name: Generate a changelog + run: git-cliff -vv --latest --unreleased --strip header --config .github/workflows/conf.toml --tag v${{needs.tag.outputs.newtag}} -o log.md env: - OUTPUT: CHANGES.md + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Cat Changelog - run: cat ${{ steps.git-cliff.outputs.changelog }} + run: cat log.md - name: Create Release uses: actions/create-release@v1 @@ -51,5 +57,5 @@ jobs: with: tag_name: "v${{needs.tag.outputs.newtag}}" release_name: "v${{needs.tag.outputs.newtag}}" - body: ${{ steps.git-cliff.outputs.content }} + body_path: log.md diff --git a/.github/workflows/configs/conf.toml b/.github/workflows/configs/conf.toml index 9c5689227..621e29175 100644 --- a/.github/workflows/configs/conf.toml +++ b/.github/workflows/configs/conf.toml @@ -13,7 +13,7 @@ body = """ {% for group, commits in commits | group_by(attribute="group") %} ### {{ group | upper_first }} {% for commit in commits %} - - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ github_repo_link }}/commit/{{ commit.id }})) by {{ commit.author.name }}\ + - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ github_repo_link }}/commit/{{ commit.id }})) \ {% endfor %} {% endfor %}\n @@ -40,9 +40,10 @@ filter_unconventional = false split_commits = false # regex for parsing and grouping commits -# commit_preprocessors = [ -# {pattern = "username", replace_command="gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/ncvescera/provaactions/commits/$COMMIT_SHA | jq -r .author.login"}, -# ] +commit_preprocessors = [ + {pattern = ".*", replace_command="echo -n \"$(head -1 $@) @$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/ncvescera/provaactions/commits/$COMMIT_SHA | jq -r .author.login)\""} +] + commit_parsers = [ { message = "^feat", group = "Features 🚀"}, { message = "^fix", group = "Fixes 🔨"}, From 332de65b402e4e645fa6a2fd621b4bed2ff9adf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Vescera?= Date: Wed, 9 Aug 2023 20:37:53 +0000 Subject: [PATCH 2/2] fix: repo path Corretto il path della repo da cui prendere i commit. --- .github/workflows/configs/conf.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/configs/conf.toml b/.github/workflows/configs/conf.toml index 621e29175..27d2fc19a 100644 --- a/.github/workflows/configs/conf.toml +++ b/.github/workflows/configs/conf.toml @@ -41,7 +41,7 @@ split_commits = false # regex for parsing and grouping commits commit_preprocessors = [ - {pattern = ".*", replace_command="echo -n \"$(head -1 $@) @$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/ncvescera/provaactions/commits/$COMMIT_SHA | jq -r .author.login)\""} + {pattern = ".*", replace_command="echo -n \"$(head -1 $@) @$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/Typing-Monkeys/AppuntiUniversita/commits/$COMMIT_SHA | jq -r .author.login)\""} ] commit_parsers = [