mirror of
https://github.com/creyD/autoflake_action.git
synced 2026-04-12 19:40:29 +02:00
Minor Cleanup
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set
|
||||
# x would be for showing the commands before they are executed
|
||||
set -eu
|
||||
shopt -s globstar
|
||||
|
||||
# FUNCTIONS
|
||||
# Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh)
|
||||
@@ -25,6 +26,10 @@ _git_changed() {
|
||||
[[ -n "$(git status -s)" ]]
|
||||
}
|
||||
|
||||
_git_changes() {
|
||||
git diff
|
||||
}
|
||||
|
||||
git config --global --add safe.directory /github/workspace
|
||||
|
||||
echo "Running autoflake..."
|
||||
@@ -37,7 +42,9 @@ fi
|
||||
if _git_changed;
|
||||
then
|
||||
if $INPUT_DRY; then
|
||||
echo "Found non-compliant files!"
|
||||
echo "Unpretty Files Changes:"
|
||||
_git_changes
|
||||
echo "Finishing dry-run. Exiting before committing."
|
||||
exit 1
|
||||
else
|
||||
# Calling method to configure the git environemnt
|
||||
|
||||
Reference in New Issue
Block a user