self-host/smart-commit/smart-commit.sh

11 lines
173 B
Bash

#! /bin/sh
STATUS=$(git status --porcelain)
STATUS_LEN=${#STATUS}
if [ $STATUS_LEN = 0 ]; then
exit 0
else
git add .
git commit -qm "CI/CD Commit: $(date -Iseconds)"
fi