Skip to content

Commit 6fef27a

Browse files
authored
Update main.yml test5 #GITBUILD
1 parent 1290de9 commit 6fef27a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: .github/workflows/main.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ jobs:
5858
id: get_commits
5959
shell: bash
6060
run: |
61-
# Get the most recent tag (assuming releases are tagged)
62-
PREV_TAG=$(git describe --tags --abbrev=0)
63-
echo "Previous tag: $PREV_TAG"
64-
65-
# List commits since last tag
66-
COMMITS=$(git log $PREV_TAG..HEAD --pretty=format:"* %s" --no-merges)
61+
# Get the most recent tag
62+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
63+
if [ "$PREV_TAG" = "none" ]; then
64+
echo "No previous tag found, listing all commits"
65+
COMMITS=$(git log --pretty=format:"* %s" --no-merges)
66+
else
67+
echo "Previous tag: $PREV_TAG"
68+
# List commits since last tag
69+
COMMITS=$(git log $PREV_TAG..HEAD --pretty=format:"* %s" --no-merges)
70+
fi
6771
echo "Commits since last release: $COMMITS"
6872
6973
# Save commits to environment file for later use

0 commit comments

Comments
 (0)