From 8790b043b6a287ba0fac3b479d25e332a874c1a3 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 16 Mar 2020 16:03:20 +0100 Subject: [PATCH] Added documentation for dry option --- README.md | 1 + entrypoint.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a1caba2..c4295ff 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A GitHub action for styling files with [prettier](https://prettier.io). | 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. | | prettier_options | :x: | `--write **/*.js` | Prettier options (by default it applies to the whole repository) | | commit_options | :x: | - | Custom git commit options | | commit_message | :x: | Prettified Code! | Custom git commit message | diff --git a/entrypoint.sh b/entrypoint.sh index 27e2e6a..540deca 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -41,12 +41,13 @@ npm install --silent --global prettier echo "Prettifing files..." echo "Files:" -prettier $INPUT_PRETTIER_OPTIONS +prettier $INPUT_PRETTIER_OPTIONS || echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS" # To keep runtime good, just continue if something was changed if _git_changed; then if $INPUT_DRY; then + echo "Prettier found unpretty files." exit 1 else # Calling method to configure the git environemnt