Skip to content

Commit 3ed6794

Browse files
committedSep 18, 2024··
Update readme: add CI integration section
1 parent bf18017 commit 3ed6794

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
 

‎.github/workflows/cs.yml ‎.github/workflows/cs-fix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
branches:
44
- '*'
55

6-
name: Code Style
6+
name: Fix Code Style
77

88
jobs:
99
cs-fix:

‎README.md

+34
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,37 @@ Now you can run the following commands:
4949
composer cs:diff
5050
composer cs:fix
5151
```
52+
53+
## CI integration
54+
55+
If you want to integrate code style check into CI, add the following step to your GitHub Actions configuration file:
56+
57+
```yaml
58+
on:
59+
push:
60+
branches:
61+
- '*'
62+
63+
name: Check Code Style
64+
65+
jobs:
66+
cs-fix:
67+
uses: spiral/gh-actions/.github/workflows/cs.yml@master
68+
```
69+
70+
If you want GitHub Actions to automatically fix the found errors, add the following step:
71+
72+
```yaml
73+
on:
74+
push:
75+
branches:
76+
- '*'
77+
78+
name: Fix Code Style
79+
80+
jobs:
81+
cs-fix:
82+
permissions:
83+
contents: write
84+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
85+
```

0 commit comments

Comments
 (0)
Please sign in to comment.