File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,15 @@ jobs:
2222 run : pip install black
2323 - name : If needed, commit black changes to the pull request
2424 run : |
25- black .
26- git config --global user.name 'formatting'
27- git config --global user.email 'mikeheddes@users.noreply.github.com'
28- git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
29- git checkout $GITHUB_HEAD_REF
30- git commit -am "Format Python code"
31- git push
25+ if black --check .
26+ then
27+ echo "nothing to do"
28+ else
29+ black .
30+ git config --global user.name 'formatting'
31+ git config --global user.email 'mikeheddes@users.noreply.github.com'
32+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
33+ git checkout $GITHUB_HEAD_REF
34+ git commit -am "Format Python code"
35+ git push
36+ fi
You can’t perform that action at this time.
0 commit comments