mirror of
https://github.com/creyD/autopep8_action.git
synced 2026-04-12 19:40:28 +02:00
Fixed the git status bug
This commit is contained in:
@@ -20,12 +20,16 @@ EOF
|
|||||||
git config --global user.name "GitHub Action"
|
git config --global user.name "GitHub Action"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Checks if any files are changed
|
||||||
|
_git_changed() {
|
||||||
|
[[ -n "$(git status -s)" ]]
|
||||||
|
}
|
||||||
|
|
||||||
echo "Running autopep8..."
|
echo "Running autopep8..."
|
||||||
autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!"
|
autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!"
|
||||||
|
|
||||||
git status -s
|
if _git_changed;
|
||||||
|
then
|
||||||
if [-n "$(git status -s)"]; then
|
|
||||||
if $INPUT_DRY; then
|
if $INPUT_DRY; then
|
||||||
echo "Found non-compliant files!"
|
echo "Found non-compliant files!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user