Skip to content

Commit 0c6039f

Browse files
author
Github Actions
committed
Deployed to github pages
1 parent 78b0940 commit 0c6039f

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ This does a few things:
4141

4242
Hopefully in the future when `actions` matures the yaml can be simplified.
4343

44+
### using this action with custom invocations
45+
46+
By default, this action runs all the hooks against all the files. `extra_args`
47+
lets users specify a single hook id and/or options to pass to `pre-commit run`.
48+
49+
Here's a sample step configuration that only runs the `flake8` hook against all
50+
the files (use the template above except for the `pre-commit` action):
51+
52+
```yaml
53+
- uses: pre-commit/[email protected]
54+
with:
55+
extra_args: flake8 --all-files
56+
```
57+
4458
### using this action in private repositories
4559

4660
this action also provides an additional behaviour when used in private

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: pre-commit
22
description: run pre-commit and optionally commit back to the pull request
33
inputs:
4+
extra_args:
5+
description: options to pass to pre-commit run
6+
required: false
7+
default: '--all-files'
48
token:
59
description: github token to clone / push with
610
required: false

0 commit comments

Comments
 (0)