mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
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:
parent
0cc199d351
commit
0b3ebf86a3
1 changed files with 14 additions and 0 deletions
14
.github/workflows/pre-commit.yml
vendored
Normal file
14
.github/workflows/pre-commit.yml
vendored
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue