From 866a8df310964ce5c933fe13a2ff730c71acc758 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Tue, 21 Apr 2026 19:59:40 +0300 Subject: [PATCH] ci: fix changelog step on shallow checkout and small repos - Set fetch-depth: 0 so previous tag lookups work across full history. - Use `-n 20` instead of HEAD~20..HEAD, which fails when the repo has fewer than 20 commits (e.g. on the first release). --- .gitea/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 42a2f86..e63eeff 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Extract version from tag id: version @@ -69,7 +71,7 @@ jobs: run: | PREV_TAG=$(git tag --sort=-v:refname | head -2 | tail -1) if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "${{ gitea.ref_name }}" ]; then - CHANGELOG=$(git log --oneline --no-decorate HEAD~20..HEAD) + CHANGELOG=$(git log --oneline --no-decorate -n 20) else CHANGELOG=$(git log --oneline --no-decorate ${PREV_TAG}..HEAD) fi