From ca2815e08ce56471b7964b761c7a998a365429cf Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 11 Apr 2021 18:27:34 -0400 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index f14a44ce..aeca86d9 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,26 @@ jobs: ``` +### Running [pre-commit](https://pre-commit.com/) on all modified files + +```yaml +... + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v3.2 + + - name: Pre-commit + uses: pre-commit/action@v2.0.0 + with: + extra_args: -v --hook-stage push --files ${{ steps.changed-files.outputs.all_modified_files }} + token: ${{ secrets.github_token }} +``` + ## Inputs