diff --git a/Dockerfile b/Dockerfile index 7bc8d08..af9f02c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3-slim RUN apt update && apt -y upgrade -RUN apt install -y curl jq sort uniq +RUN apt install -y curl jq RUN pip install black diff --git a/run_black_on_git_diff_adds.sh b/run_black_on_git_diff_adds.sh index e60f1f5..fdc79e6 100755 --- a/run_black_on_git_diff_adds.sh +++ b/run_black_on_git_diff_adds.sh @@ -18,7 +18,7 @@ echo "looking for diff at ${github_pr_url}" curl --request GET --url ${github_pr_url} --header "authorization: Bearer ${GITHUB_TOKEN}" --header "Accept: application/vnd.github.v3.diff" > github_diff.txt diff_length=`wc -l github_diff.txt` echo "approximate diff size: ${diff_length}" -python_files=`cat github_diff.txt | grep -E -- "\+\+\+ |\-\-\- " | awk '{print $2}' | grep -Po -- "(?<=[ab]/).+\.py$ | sort | uniq"` +python_files=`cat github_diff.txt | grep -E -- "\+\+\+ |\-\-\- " | awk '{print $2}' | grep -Po -- "(?<=[ab]/).+\.py$"` echo "python files edited in this PR: ${python_files}" if [[ -z "${LINE_LENGTH}" ]]; then