Skip to content

Commit

Permalink
Added dry mode
Browse files Browse the repository at this point in the history
  • Loading branch information
creyD committed Mar 16, 2020
1 parent 8bd9c88 commit 0301881
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ inputs:
required: false
default: '--write **/*.js'
branch:
description: Branch which the changes are merged to
description: Target branch for the changes
required: true
dry:
description: Running the script in dry mode just shows whether there are files that should be prettified or not
required: false
default: False

runs:
using: 'docker'
Expand Down
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ echo "Installing prettier..."
npm install --silent --global prettier

echo "Prettifing files..."
prettier $INPUT_PRETTIER_OPTIONS || echo "Problem while prettifying your files with options $INPUT_PRETTIER_OPTIONS"
echo "Files:"
prettier $INPUT_PRETTIER_OPTIONS || echo "Problem while prettifying your files with options $INPUT_PRETTIER_OPTIONS."

# To keep runtime good, just continue if something was changed
if _git_changed;
if [! $INPUT_DRY] && [_git_changed];
then
# Calling method to configure the git environemnt
_git_setup
Expand Down

0 comments on commit 0301881

Please sign in to comment.