Workflow changes (#11692)

Modifying workflows to install python for make commands
Squashing CI tasks to remove repeated steps
Modifying pre-commit.sh to not fail if there are no python file changes
This commit is contained in:
John Westcott IV
2022-02-07 15:42:35 -05:00
committed by GitHub
parent 264f1d6638
commit c8b906ffb7
7 changed files with 81 additions and 154 deletions

View File

@@ -1,6 +1,8 @@
if [ -z $AWX_IGNORE_BLACK ]
then
black --check $(git diff --cached --name-only --diff-filter=AM | grep -E '\.py') || \
(echo 'To fix this, run `make black` to auto-format your code prior to commit, or set AWX_IGNORE_BLACK=1' && \
exit 1)
if [ -z $AWX_IGNORE_BLACK ] ; then
python_files_changed=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.py')
if [ "x$python_files_changed" != "x" ] ; then
black --check $python_files_changed || \
(echo 'To fix this, run `make black` to auto-format your code prior to commit, or set AWX_IGNORE_BLACK=1' && \
exit 1)
fi
fi