ci: fix changelog step on shallow checkout and small repos
Release / release (push) Failing after 54s

- 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).
This commit is contained in:
2026-04-21 19:59:40 +03:00
parent 56b345188e
commit 866a8df310
+3 -1
View File
@@ -15,6 +15,8 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from tag - name: Extract version from tag
id: version id: version
@@ -69,7 +71,7 @@ jobs:
run: | run: |
PREV_TAG=$(git tag --sort=-v:refname | head -2 | tail -1) PREV_TAG=$(git tag --sort=-v:refname | head -2 | tail -1)
if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "${{ gitea.ref_name }}" ]; then 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 else
CHANGELOG=$(git log --oneline --no-decorate ${PREV_TAG}..HEAD) CHANGELOG=$(git log --oneline --no-decorate ${PREV_TAG}..HEAD)
fi fi