Demonstrate a GitHub Action that runs pre-commit

This GitHub Action will `run pre-commit` in any repo that contains a valid `.pre-commit-config.yaml` file.
This Action will run on all push or pull_request actions to ensure that all pre-commit tests pass _before_ code review.
This commit is contained in:
Christian Clauss 2020-01-29 14:20:58 +01:00 committed by GitHub
parent 0cc199d351
commit 0b3ebf86a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

14
.github/workflows/pre-commit.yml vendored Normal file
View file

@ -0,0 +1,14 @@
# https://pre-commit.com
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
name: pre-commit
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files