update-20260401-164046-18676
This commit is contained in:
14
push.sh
14
push.sh
@@ -3,25 +3,21 @@ set -e
|
|||||||
|
|
||||||
BRANCH="main"
|
BRANCH="main"
|
||||||
|
|
||||||
# Stop if not inside a git repo
|
|
||||||
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
|
|
||||||
echo "Not inside a git repository."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if there are changes
|
|
||||||
if [ -z "$(git status --porcelain)" ]; then
|
if [ -z "$(git status --porcelain)" ]; then
|
||||||
echo "No changes to commit."
|
echo "No changes to commit."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Random commit message
|
|
||||||
MSG="update-$(date +%Y%m%d-%H%M%S)-$RANDOM"
|
MSG="update-$(date +%Y%m%d-%H%M%S)-$RANDOM"
|
||||||
|
|
||||||
echo "Using commit message: $MSG"
|
echo "Using commit message: $MSG"
|
||||||
|
|
||||||
|
echo "==> git add"
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
|
echo "==> git commit"
|
||||||
git commit -m "$MSG"
|
git commit -m "$MSG"
|
||||||
|
|
||||||
|
echo "==> git push"
|
||||||
git push origin "$BRANCH"
|
git push origin "$BRANCH"
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
Reference in New Issue
Block a user