mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-15 21:00:35 +02:00
Added prettier_version parameter
This commit is contained in:
@@ -12,6 +12,7 @@ A GitHub action for styling files with [prettier](https://prettier.io).
|
|||||||
| Parameter | Required | Default | Description |
|
| Parameter | Required | Default | Description |
|
||||||
| - | :-: | :-: | - |
|
| - | :-: | :-: | - |
|
||||||
| dry | :x: | False | Runs the action in dry mode. Files wont get changed and the action fails if there are unprettified files. |
|
| dry | :x: | False | Runs the action in dry mode. Files wont get changed and the action fails if there are unprettified files. |
|
||||||
|
| prettier_version | :x: | False | Specific prettier version (by default use latest) |
|
||||||
| prettier_options | :x: | `--write **/*.js` | Prettier options (by default it applies to the whole repository) |
|
| prettier_options | :x: | `--write **/*.js` | Prettier options (by default it applies to the whole repository) |
|
||||||
| commit_options | :x: | - | Custom git commit options |
|
| commit_options | :x: | - | Custom git commit options |
|
||||||
| commit_message | :x: | Prettified Code! | Custom git commit message |
|
| commit_message | :x: | Prettified Code! | Custom git commit message |
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ inputs:
|
|||||||
description: Running the script in dry mode just shows whether there are files that should be prettified or not
|
description: Running the script in dry mode just shows whether there are files that should be prettified or not
|
||||||
required: false
|
required: false
|
||||||
default: False
|
default: False
|
||||||
|
prettier_version:
|
||||||
|
description: Specific version of prettier (by default just use the latest version)
|
||||||
|
required: false
|
||||||
|
default: False
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ _git_push() {
|
|||||||
|
|
||||||
# PROGRAM
|
# PROGRAM
|
||||||
echo "Installing prettier..."
|
echo "Installing prettier..."
|
||||||
npm install --silent --global prettier
|
if $INPUT_PRETTIER_VERSION; then
|
||||||
|
npm install --silent --global prettier@$INPUT_PRETTIER_VERSION
|
||||||
|
else
|
||||||
|
npm install --silent --global prettier
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Prettifing files..."
|
echo "Prettifing files..."
|
||||||
echo "Files:"
|
echo "Files:"
|
||||||
|
|||||||
Reference in New Issue
Block a user