Skip to content

Commit 0f22efb

Browse files
authored
Update generate-release-note.yml
1 parent 84b48e8 commit 0f22efb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/generate-release-note.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
should-release: ${{ steps.check.outputs.should-release }}
2020
version: ${{ steps.check.outputs.version }}
2121
tag: ${{ steps.check.outputs.tag }}
22+
latest_tag: ${{ steps.check.outputs.latest_tag }}
2223
steps:
2324
- name: Checkout code
2425
uses: actions/checkout@v4
@@ -43,7 +44,16 @@ jobs:
4344
exit 0
4445
fi
4546
47+
IFS='.' read -r MAJOR MINOR PATCH <<< "${{ github.ref_name }}"
48+
49+
if [[ -z "$MAJOR" || -z "$MINOR" || -z "$PATCH" ]]; then
50+
LATEST_TAG=null
51+
else
52+
LATEST_TAG=$(git tag --list "${MAJOR}.${MINOR}.*" | sort -V | tail -n 1)
53+
fi
54+
4655
echo "should-release=true" >> $GITHUB_OUTPUT
56+
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
4757
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
4858
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
4959
@@ -61,7 +71,7 @@ jobs:
6171
id: generate_notes
6272
run: |
6373
# Get the latest tag
64-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
74+
LATEST_TAG="${{ needs.check-for-release.outputs.latest_tag }}"
6575
6676
if [ -z "$LATEST_TAG" ]; then
6777
# If no previous tag, get all commits
@@ -83,6 +93,10 @@ jobs:
8393
elif echo "$commit" | grep -qE "^- feat"; then
8494
FEATURES="$FEATURES$commit"$'\n'
8595
elif echo "$commit" | grep -qE "^- fix"; then
96+
# Skip "Fix styling" commits
97+
if echo "$commit" | grep -qE "Fix styling"; then
98+
continue
99+
fi
86100
FIXES="$FIXES$commit"$'\n'
87101
else
88102
OTHER="$OTHER$commit"$'\n'
@@ -114,9 +128,6 @@ jobs:
114128
RELEASE_NOTES="$RELEASE_NOTES""composer require solution-forest/inspirecms-core:^${{ needs.check-for-release.outputs.version }}"$'\n'
115129
RELEASE_NOTES="$RELEASE_NOTES\`\`\`"$'\n\n'
116130
117-
# Save to file for GitHub release
118-
echo "$RELEASE_NOTES" > release_notes.md
119-
120131
# Output for GitHub (escape newlines)
121132
echo "notes<<EOF" >> $GITHUB_OUTPUT
122133
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)