Skip to content

Commit 75b9a12

Browse files
committed
Update release.yml
1 parent d34f14c commit 75b9a12

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ jobs:
162162
# Get commits since last tag
163163
LAST_TAG=${{ steps.get_tag.outputs.latest_tag }}
164164
if [ "$LAST_TAG" = "v0.0.0" ]; then
165-
COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~10..HEAD)
165+
# Check how many commits we have and use that as the limit
166+
COMMIT_COUNT=$(git rev-list --count HEAD)
167+
if [ "$COMMIT_COUNT" -gt 10 ]; then
168+
COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~10..HEAD)
169+
else
170+
COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~$COMMIT_COUNT..HEAD 2>/dev/null || git log --oneline --pretty=format:"- %s")
171+
fi
166172
else
167173
COMMITS=$(git log --oneline --pretty=format:"- %s" $LAST_TAG..HEAD)
168174
fi

0 commit comments

Comments
 (0)