From ab7a203db7c816f5c4356c05e12f3f23e0623390 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 5 Nov 2022 10:02:50 +0100 Subject: [PATCH] Check if git binary exists --- action.yml | 3 +++ entrypoint.sh | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/action.yml b/action.yml index 6479721..044e0e0 100644 --- a/action.yml +++ b/action.yml @@ -70,6 +70,9 @@ inputs: create_branch: description: Create new branch with the name of `branch`-input in local and remote repository, if it doesn't exist yet. default: false + internal_git_binary: + description: Internal use only. Path git binary that should be used. + default: git outputs: changes_detected: diff --git a/entrypoint.sh b/entrypoint.sh index fc8ba43..9d9f9bf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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,11 @@ _main() { fi } +_check_if_git_is_available() { + PATH_TO_GIT=$(which $INPUT_INTERNAL_GIT_BINARY); + + echo "::debug::Path to git binary ${PATH_TO_GIT}"; +} _switch_to_repository() { echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY";