WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 880ade9

Browse files
authored
Merge pull request #8 from pre-commit-ci/readme
document lite-action
2 parents 7c2be75 + 6dc6ab2 commit 880ade9

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[![Build Status](https://github.com/pre-commit-ci/lite-action/actions/workflows/main.yml/badge.svg)](https://github.com/pre-commit-ci/lite-action/actions/workflows/main.yml)
2+
3+
action-lite
4+
===========
5+
6+
**pre-commit.ci lite** is an add-on for GitHub Actions which safely auto
7+
fixes PRs
8+
9+
### setup
10+
11+
1. install the [GitHub Application] on the relevant repositories
12+
2. add the [GitHub action] to your workflow as the last step in your job:
13+
14+
```yaml
15+
- uses: pre-commit-ci/[email protected]
16+
if: always()
17+
```
18+
19+
*note:* the step must have either the default `name` or contain the text
20+
`pre-commit-ci-lite`. the application uses this to find the right workflow.
21+
22+
### options
23+
24+
- `msg`: (default `[pre-commit.ci lite] apply automatic fixes`): commit message
25+
used for auto fixing
26+
27+
```yaml
28+
- uses: pre-commit-ci/[email protected]
29+
if: always()
30+
with:
31+
msg: apply code formatting
32+
```
33+
34+
### example using [pre-commit/action]
35+
36+
technically _pre-commit.ci lite_ works for any code modification, though it was
37+
built with `pre-commit` in mind. here is an example workflow:
38+
39+
```yaml
40+
on:
41+
pull_request:
42+
push:
43+
branches: [main, test-me-*]
44+
45+
jobs:
46+
main:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v3
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: 3.x
53+
- uses: pre-commit/[email protected]
54+
- uses: pre-commit-ci/[email protected]
55+
if: always()
56+
```
57+
58+
[GitHub Application]: https://github.com/apps/pre-commit-ci-lite/installations/new
59+
[GitHub action]: https://github.com/pre-commit-ci/lite-action
60+
[pre-commit/action]: https://github.com/pre-commit/action

0 commit comments

Comments
 (0)