From c8d9e2fc74c2a7a3bdb22c6a3c94aacc88ef6574 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 6 May 2020 12:30:39 +0200 Subject: [PATCH] Fixed the git status bug --- entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 100415f..e0feaa6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,12 +20,16 @@ EOF git config --global user.name "GitHub Action" } +# Checks if any files are changed +_git_changed() { + [[ -n "$(git status -s)" ]] +} + echo "Running autopep8..." autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!" -git status -s - -if [-n "$(git status -s)"]; then +if _git_changed; +then if $INPUT_DRY; then echo "Found non-compliant files!" exit 1