Added dry mode

This commit is contained in:
2020-03-16 15:30:17 +01:00
parent 8bd9c88a06
commit 03018818a5
2 changed files with 8 additions and 3 deletions

View File

@@ -20,8 +20,12 @@ inputs:
required: false required: false
default: '--write **/*.js' default: '--write **/*.js'
branch: branch:
description: Branch which the changes are merged to description: Target branch for the changes
required: true 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: runs:
using: 'docker' using: 'docker'

View File

@@ -40,10 +40,11 @@ echo "Installing prettier..."
npm install --silent --global prettier npm install --silent --global prettier
echo "Prettifing files..." 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 # To keep runtime good, just continue if something was changed
if _git_changed; if [! $INPUT_DRY] && [_git_changed];
then then
# Calling method to configure the git environemnt # Calling method to configure the git environemnt
_git_setup _git_setup