From 0b3ebf86a3b5d120195d1590f02cb3fc7ec31e82 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 29 Jan 2020 14:20:58 +0100 Subject: [PATCH] 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. --- .github/workflows/pre-commit.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..69a05386 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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