chore: automate changelog and version commit in pre-push hook

- Enhanced the pre-push hook to automatically stage and commit changes to CHANGELOG.md and Makefile, streamlining the version update process.
- Added error handling to ensure the push proceeds even if the commit fails due to no changes.
This commit is contained in:
anonpenguin23 2025-11-03 07:24:06 +02:00
parent 09c903dd14
commit a17255e6b4

View File

@ -57,6 +57,18 @@ if [ -f "$CHANGELOG_SCRIPT" ]; then
fi
echo -e "${GREEN}Proceeding with push...${NOCOLOR}"
# Commit the updated CHANGELOG.md and Makefile
echo -e "${CYAN}Staging CHANGELOG.md and Makefile...${NOCOLOR}"
git add CHANGELOG.md Makefile
echo -e "${CYAN}Committing changes...${NOCOLOR}"
NEW_VERSION=$(cat "$VERSION_FILE")
git commit -m "chore: update changelog and version to $NEW_VERSION" || {
# If commit fails (e.g., no changes to commit), continue anyway
echo -e "${YELLOW}Note: Could not commit changes (may already be committed)${NOCOLOR}"
}
# Clean up temp files
rm -f "$PREVIEW_FILE" "$VERSION_FILE"
fi