Skip to content

Commit

Permalink
Added documentation for dry option
Browse files Browse the repository at this point in the history
  • Loading branch information
creyD committed Mar 16, 2020
1 parent 527f15c commit 8790b04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8790b04

Please sign in to comment.