Skip to content

Commit 9cd1a42

Browse files
committed
feat: enhance changelog generation and update Taskfile with new hooks and tasks
1 parent e5ed0a5 commit 9cd1a42

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Restore pull request template with structured guidelines _(2025-10-16)_
2323
- Add CHANGELOG and enhance README with documentation navigation _(2025-10-16)_
2424
- Add commit message validation script for Conventional Commits _(2025-10-16)_
25+
- Enhance changelog generation and update Taskfile with new tasks _(2025-10-16)_
2526

2627
### 🐛 Bug Fixes
2728

Taskfile.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,33 @@ tasks:
4646
- git cliff --latest --output CHANGELOG.md --prepend
4747

4848
changelog:setup-hook:
49-
desc: Setup git hook to automatically update changelog on commit
49+
desc: Setup git hook to automatically update and commit changelog
5050
cmds:
5151
- echo '#!/bin/bash' > .git/hooks/post-commit
52-
- echo 'git cliff --output CHANGELOG.md' >> .git/hooks/post-commit
52+
- echo 'git cliff --output CHANGELOG.md' >> .git/hooks/post-commit
53+
- echo 'git add CHANGELOG.md' >> .git/hooks/post-commit
54+
- echo 'git diff --cached --quiet || git commit --amend --no-edit' >> .git/hooks/post-commit
5355
- chmod +x .git/hooks/post-commit
54-
- echo "Git hook installed! Changelog will update automatically on each commit."
56+
- echo "Git hook installed! Changelog will update and amend automatically on each commit."
57+
58+
changelog:setup-pre-commit:
59+
desc: Setup pre-commit hook to update changelog before committing
60+
cmds:
61+
- echo '#!/bin/bash' > .git/hooks/pre-commit
62+
- echo 'git cliff --output CHANGELOG.md' >> .git/hooks/pre-commit
63+
- echo 'git add CHANGELOG.md' >> .git/hooks/pre-commit
64+
- chmod +x .git/hooks/pre-commit
65+
- echo "Pre-commit hook installed! Changelog will update automatically before each commit."
66+
67+
changelog:remove-hooks:
68+
desc: Remove changelog git hooks
69+
cmds:
70+
- rm -f .git/hooks/post-commit .git/hooks/pre-commit
71+
- echo "Git hooks removed."
72+
73+
changelog:commit:
74+
desc: Update changelog and commit it
75+
cmds:
76+
- git cliff --output CHANGELOG.md
77+
- git add CHANGELOG.md
78+
- git commit -m "docs: update changelog" || echo "No changes to commit"

0 commit comments

Comments
 (0)