Skip to content

Commit a3d30d7

Browse files
committed
chore: update generation script
1 parent 6940e0d commit a3d30d7

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/generate_changelog.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,30 @@ generate_categorized_changelog() {
1212

1313
echo "## What's Changed"
1414

15+
# Store all commits in a temporary file
16+
all_commits=$(mktemp)
17+
$git_log_command --pretty=format:"* %s (%h)" --reverse > "$all_commits"
18+
1519
# Features
1620
echo "### 🚀 Features"
17-
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* feat" || true
21+
grep -i "^* feat:" "$all_commits" || true
1822

1923
# Bug Fixes
2024
echo -e "\n### 🐛 Bug Fixes"
21-
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* fix" || true
25+
grep -i "^* fix:" "$all_commits" || true
2226

2327
# Documentation
2428
echo -e "\n### 📚 Documentation"
25-
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep "^* docs" || true
29+
grep -i "^* docs:" "$all_commits" || true
2630

2731
# Other Changes
2832
echo -e "\n### 🔧 Other Changes"
29-
$git_log_command --pretty=format:"* %s (%h)" --reverse | grep -v "^* feat\|^* fix\|^* docs" || true
33+
grep -i -v "^* feat:\|^* fix:\|^* docs:" "$all_commits" || true
34+
35+
# Cleanup
36+
rm "$all_commits"
3037
}
3138

32-
# Usage in workflow:
33-
# CHANGELOG=$(generate_categorized_changelog "$PREVIOUS_TAG")
34-
# echo "CHANGELOG<<EOF" >> $GITHUB_ENV
35-
# echo "$CHANGELOG" >> $GITHUB_ENV
36-
# echo "EOF" >> $GITHUB_ENV
39+
# Usage example:
40+
# changelog=$(generate_categorized_changelog "v1.0.0")
41+
# echo "$changelog"

.github/workflows/ci_check_release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ jobs:
244244
name: ${{ env.VERSION }}
245245
body: |
246246
${{ env.CHANGELOG }}
247+
248+
247249
**Full Changelog**: ${{ env.URL }}
248250
draft: false
249251
prerelease: false

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python-template"
3-
version = "0.5.28"
3+
version = "0.5.29"
44
description = "Used to templatize python projects."
55
authors = ["Loïc Motheu <lmotheu@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)