File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : pre-commit
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - " *"
7+ push :
8+ branches :
9+ - " master"
10+
11+ jobs :
12+ pre-commit :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+ - uses : actions/setup-python@v2
17+ with :
18+ python-version : " 3.8"
19+ - name : Get python version
20+ run : echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
21+ - uses : actions/cache@v1
22+ with :
23+ path : ~/.cache/pre-commit
24+ key : pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
25+ - name : Install pre-commit
26+ run : pip install pre-commit
27+ - name : Run pre-commit
28+ run : pre-commit run --all-files --show-diff-on-failure --color=always
29+ - name : Check that all files generated by pre-commit are in git
30+ run : |
31+ newfiles="$(git ls-files --others --exclude-from=.gitignore)"
32+ if [ "$newfiles" != "" ] ; then
33+ echo "Please check-in the following files:"
34+ echo "$newfiles"
35+ exit 1
36+ fi
You can’t perform that action at this time.
0 commit comments