File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,17 +45,17 @@ jobs:
4545 id : changelog
4646 run : |
4747 # Get the previous tag
48- PREVIOUS_TAG=$(git describe --abbrev=0 --tags ${{ steps.create_tag.outputs.previous_tag }} 2>/dev/null || echo "")
48+ PREVIOUS_TAG=$(git describe --abbrev=0 --tags HEAD^ 2>/dev/null || echo "")
4949
5050 if [ -z "$PREVIOUS_TAG" ]; then
51- echo "No previous tag found, generating changelog from all commits"
52- PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
51+ echo "No previous tag found, generating changelog from last 50 commits"
52+ CHANGELOG=$(git log -50 --pretty=format:"- %s (%h)" --no-merges)
53+ else
54+ echo "Generating changelog from $PREVIOUS_TAG to HEAD"
55+ CHANGELOG=$(git log $PREVIOUS_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges)
5356 fi
5457
55- echo "Generating changelog from $PREVIOUS_TAG to ${{ steps.create_tag.outputs.new_tag }}"
56-
5758 # Generate changelog
58- CHANGELOG=$(git log $PREVIOUS_TAG..${{ steps.create_tag.outputs.new_tag }} --pretty=format:"- %s (%h)" --no-merges)
5959
6060 # Group commits by type
6161 FEATURES=$(echo "$CHANGELOG" | grep -i "^- feature:" || echo "")
You can’t perform that action at this time.
0 commit comments