-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flesh out entrypoint, give a more descriptive name
- Loading branch information
Raymond Gasper
committed
May 26, 2020
1 parent
555f6a9
commit 1718686
Showing
5 changed files
with
114 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
FROM python:3 | ||
FROM python:3-slim | ||
|
||
RUN apt update && apt -y upgrade | ||
RUN pip install black | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
COPY run_black_on_git_diff_adds.sh /run_black_on_git_diff_adds.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
ENTRYPOINT ["/run_black_on_git_diff_adds.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
if [[ ${GITHUB_EVENT_NAME} != "pull_request" ]] | ||
then | ||
echo "this action runs only on pull request events" | ||
exit 1 | ||
fi | ||
|
||
github_pr_url=`echo -En ${GITHUB_EVENT_PATH} | jq '.pull_request.url'` | ||
github_diff=`curl --request GET --url ${github_pr_url} --header "authorization: Bearer ${GITHUB_TOKEN}" --header "Accept: application/vnd.github.v3.diff"` | ||
list_of_edited_files=`echo -En ${github_diff} | grep -E -- "\+\+\+ " | awk '{print $2}' | grep -Po -- "(?<=[ab]/).+(.py$)"` | ||
|
||
black ${list_of_edited_files} |