File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ CodeFactor] ( https://www.codefactor.io/repository/github/creyd/prettier_action/badge/master )] ( https://www.codefactor.io/repository/github/creyd/prettier_action/overview/master )
4
4
[ ![ code style: prettier] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square )] ( https://github.com/prettier/prettier )
5
+ [ ![ License MIT] ( https://img.shields.io/github/license/creyD/prettier_action )] ( https://github.com/creyD/prettier_action/blob/master/LICENSE )
6
+ [ ![ Latest Release] ( https://img.shields.io/github/v/release/creyD/prettier_action )] ( https://github.com/creyD/prettier_action/releases )
7
+ [ ![ Contributors] ( https://img.shields.io/github/contributors-anon/creyD/prettier_action )] ( https://github.com/creyD/prettier_action/graphs/contributors )
8
+ [ ![ Issues] ( https://img.shields.io/github/issues/creyD/prettier_action )] ( https://github.com/creyD/prettier_action/issues )
9
+
5
10
6
11
A GitHub action for styling files with [ prettier] ( https://prettier.io ) .
7
12
@@ -12,6 +17,7 @@ A GitHub action for styling files with [prettier](https://prettier.io).
12
17
| Parameter | Required | Default | Description |
13
18
| - | :-: | :-: | - |
14
19
| dry | :x : | False | Runs the action in dry mode. Files wont get changed and the action fails if there are unprettified files. |
20
+ | prettier_version | :x : | False | Specific prettier version (by default use latest) |
15
21
| prettier_options | :x : | ` --write **/*.js ` | Prettier options (by default it applies to the whole repository) |
16
22
| commit_options | :x : | - | Custom git commit options |
17
23
| commit_message | :x : | Prettified Code! | Custom git commit message |
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ inputs:
26
26
description : Running the script in dry mode just shows whether there are files that should be prettified or not
27
27
required : false
28
28
default : False
29
+ prettier_version :
30
+ description : Specific version of prettier (by default just use the latest version)
31
+ required : false
29
32
30
33
runs :
31
34
using : ' docker'
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ _git_push() {
37
37
38
38
# PROGRAM
39
39
echo " Installing prettier..."
40
- npm install --silent --global prettier
40
+ if " $INPUT_PRETTIER_VERSION " ; then
41
+ npm install --silent --global prettier@$INPUT_PRETTIER_VERSION
42
+ else
43
+ npm install --silent --global prettier
44
+ fi
41
45
42
46
echo " Prettifing files..."
43
47
echo " Files:"
You can’t perform that action at this time.
0 commit comments