Skip to content

Commit 3f07c9a

Browse files
author
changfeng
committed
fix: set git tag when latest commit is not tagged
1 parent 6d1a81b commit 3f07c9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
- name: Set GIT_TAG
6767
id: set-tag
6868
run: |
69-
GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
70-
if [ $? -eq 0 ] && [ "$(git rev-list -n 1 $GIT_TAG)" = "$(git rev-parse HEAD)" ]; then
69+
GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
70+
if [ -n "$GIT_TAG" ] && [ "$(git rev-list -n 1 $GIT_TAG 2>/dev/null || echo "")" = "$(git rev-parse HEAD)" ]; then
7171
echo "::set-output name=GIT_TAG::${GIT_TAG}"
7272
else
7373
echo "::set-output name=GIT_TAG::"

0 commit comments

Comments
 (0)