From ae87148c2c6e643c821731f05367c0db404ff4c6 Mon Sep 17 00:00:00 2001 From: Kuloud Date: Sun, 25 Aug 2024 22:49:30 +0800 Subject: [PATCH] chore: append GIT_LOG --- .github/workflows/publish.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7bf4555..e2b8685 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,12 @@ jobs: - name: Get Commit Logs id: git_log run: | - export GIT_LOG=$(git log --pretty=format:'- %s' $(git describe --tags --abbrev=0)..HEAD) + TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + if [ -z "$TAG" ]; then + GIT_LOG=$(git log --pretty=format:'- %s') + else + GIT_LOG=$(git log --pretty=format:'- %s' $TAG..HEAD) + fi echo "git_log=$GIT_LOG" >> $GITHUB_ENV - name: Create Release