mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-30 05:13:40 +00:00
feat(release): add dynamic release title generation
Release titles now automatically reflect the type of changes: - 'vX.Y.Z - New Features & Bug Fixes' (both present) - 'vX.Y.Z - New Features' (only features) - 'vX.Y.Z - Bug Fixes' (only fixes) - 'vX.Y.Z' (fallback for other changes) Determined by analyzing commit messages between previous tag and current tag. Impact: Release titles are more descriptive and immediately show what changed, making it easier for users to understand the release at a glance.
This commit is contained in:
parent
256caab2ff
commit
e1c083f40b
1 changed files with 25 additions and 0 deletions
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
|
|
@ -218,9 +218,34 @@ jobs:
|
|||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "${{ steps.version_check.outputs.warning }}" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: Generate release title
|
||||
id: release_title
|
||||
run: |
|
||||
TAG_VERSION="${GITHUB_REF#refs/tags/}"
|
||||
FROM_TAG="${{ steps.previoustag.outputs.previous_tag }}"
|
||||
|
||||
# Extract main feature types from commits
|
||||
FEAT_COUNT=$(git log ${FROM_TAG}..HEAD --format="%s" --no-merges | grep -cE "^feat(\(.+\))?:" || true)
|
||||
FIX_COUNT=$(git log ${FROM_TAG}..HEAD --format="%s" --no-merges | grep -cE "^fix(\(.+\))?:" || true)
|
||||
|
||||
# Build title based on what changed
|
||||
if [ $FEAT_COUNT -gt 0 ] && [ $FIX_COUNT -gt 0 ]; then
|
||||
TITLE="$TAG_VERSION - New Features & Bug Fixes"
|
||||
elif [ $FEAT_COUNT -gt 0 ]; then
|
||||
TITLE="$TAG_VERSION - New Features"
|
||||
elif [ $FIX_COUNT -gt 0 ]; then
|
||||
TITLE="$TAG_VERSION - Bug Fixes"
|
||||
else
|
||||
TITLE="$TAG_VERSION"
|
||||
fi
|
||||
|
||||
echo "title=$TITLE" >> $GITHUB_OUTPUT
|
||||
echo "Release title: $TITLE"
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: ${{ steps.release_title.outputs.title }}
|
||||
body: ${{ steps.release_notes.outputs.notes }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
|
|
|||
Loading…
Reference in a new issue