Skip to content

Commit 7744818

Browse files
authored
Merge pull request #2 from KiraCore/feature/cicd_pipeline
cicd: Fix changelog tagging logic
2 parents f7002e1 + c5bb738 commit 7744818

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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 "")

0 commit comments

Comments
 (0)