git-auto-commit-action/entrypoint.sh

23 lines
237 B
Bash
Raw Normal View History

2019-12-13 03:41:00 +08:00
#!/bin/bash
2019-11-01 17:10:52 +08:00
2019-06-10 20:30:50 +08:00
set -eu
2019-12-13 03:41:00 +08:00
source /lib.sh
2019-09-01 00:02:55 +08:00
2019-12-13 03:41:00 +08:00
_switch_to_repository
2019-09-01 00:02:55 +08:00
2019-12-13 03:41:00 +08:00
if _git_is_dirty; then
2019-09-01 00:02:55 +08:00
2019-12-13 03:41:00 +08:00
_setup_git
2019-12-13 03:41:00 +08:00
_switch_to_branch
2019-12-13 03:41:00 +08:00
_add_files
2019-09-20 16:43:15 +08:00
2019-12-13 03:41:00 +08:00
_local_commit
2019-09-01 00:34:01 +08:00
2019-12-13 03:41:00 +08:00
_push_to_github
else
echo "Working tree clean. Nothing to commit."
2019-09-01 00:02:55 +08:00
fi