File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,16 @@ jobs:
58
58
id : get_commits
59
59
shell : bash
60
60
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
67
71
echo "Commits since last release: $COMMITS"
68
72
69
73
# Save commits to environment file for later use
You can’t perform that action at this time.
0 commit comments