You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+12-9
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,13 @@ A GitHub action for styling files with [prettier](https://prettier.io).
18
18
| - | :-: | :-: | - |
19
19
| dry |:x:|`false`| Runs the action in dry mode. Files wont get changed and the action fails if there are unprettified files. Recommended to use with prettier_options --check |
20
20
| prettier_version |:x:|`false`| Specific prettier version (by default use latest) |
21
+
| working_directory |:x:|`false`| Specify a directory to cd into before installing prettier and running it, use relative file path to the repository root for example `app/`|
21
22
| prettier_options |:x:|`"--write **/*.js"`| Prettier options (by default it applies to the whole repository) |
| same_commit |:x:|`false`| Update the current commit instead of creating a new one, created by [Joren Broekema](https://github.com/jorenbroekema), this command works only with the checkout action set to fetch depth '0' (see example 2) |
25
26
| commit_message |:x:|`"Prettified Code!"`| Custom git commit message, will be ignored if used with `same_commit`|
27
+
| commit_description |:x:| - | Custom git extended commit message, will be ignored if used with `same_commit`|
26
28
| file_pattern |:x:|`*`| Custom git add file pattern, can't be used with only_changed! |
| only_changed |:x:|`false`| Only prettify changed files, can't be used with file_pattern! This command works only with the checkout action set to fetch depth '0' (see example 2)|
@@ -32,7 +34,8 @@ A GitHub action for styling files with [prettier](https://prettier.io).
32
34
33
35
### Example Config
34
36
35
-
#### Example 1 (run on push in master)
37
+
> Hint: if you still use the old naming convention or generally a different branch name, please replace the `main` in the following configurations.
38
+
#### Example 1 (run on push in branch main)
36
39
```yaml
37
40
name: Continuous Integration
38
41
@@ -41,7 +44,7 @@ on:
41
44
pull_request:
42
45
push:
43
46
branches:
44
-
- master
47
+
- main
45
48
46
49
jobs:
47
50
prettier:
@@ -55,7 +58,7 @@ jobs:
55
58
ref: ${{ github.head_ref }}
56
59
57
60
- name: Prettify code
58
-
uses: creyD/prettier_action@v4.0
61
+
uses: creyD/prettier_action@v4.1
59
62
with:
60
63
# This part is also where you can pass other options, for example:
61
64
prettier_options: --write **/*.{js,md}
@@ -67,7 +70,7 @@ name: Continuous Integration
67
70
68
71
on:
69
72
pull_request:
70
-
branches: [master]
73
+
branches: [main]
71
74
72
75
jobs:
73
76
prettier:
@@ -83,7 +86,7 @@ jobs:
83
86
fetch-depth: 0
84
87
85
88
- name: Prettify code
86
-
uses: creyD/prettier_action@v4.0
89
+
uses: creyD/prettier_action@v4.1
87
90
with:
88
91
# This part is also where you can pass other options, for example:
0 commit comments