mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-07-31 06:57:40 +08:00
Let Action fail if git binary can't be located (#261)
* Check if git binary exists * Add Tests
This commit is contained in:
@@ -7,6 +7,8 @@ if "$INPUT_DISABLE_GLOBBING"; then
|
||||
fi
|
||||
|
||||
_main() {
|
||||
_check_if_git_is_available
|
||||
|
||||
_switch_to_repository
|
||||
|
||||
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
|
||||
@@ -42,6 +44,14 @@ _main() {
|
||||
fi
|
||||
}
|
||||
|
||||
_check_if_git_is_available() {
|
||||
if hash -- "$INPUT_INTERNAL_GIT_BINARY" 2> /dev/null; then
|
||||
echo "::debug::git binary found.";
|
||||
else
|
||||
echo "::error ::git-auto-commit could not find git binary. Please make sure git is available."
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
_switch_to_repository() {
|
||||
echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY";
|
||||
|
Reference in New Issue
Block a user