mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-15 05:08:49 +00:00
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:
parent
09c903dd14
commit
a17255e6b4
@ -57,6 +57,18 @@ if [ -f "$CHANGELOG_SCRIPT" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}Proceeding with push...${NOCOLOR}"
|
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
|
# Clean up temp files
|
||||||
rm -f "$PREVIEW_FILE" "$VERSION_FILE"
|
rm -f "$PREVIEW_FILE" "$VERSION_FILE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user