mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-17 13:50:36 +02:00
Added hard break for dry mode
This commit is contained in:
@@ -44,19 +44,23 @@ echo "Files:"
|
|||||||
prettier $INPUT_PRETTIER_OPTIONS
|
prettier $INPUT_PRETTIER_OPTIONS
|
||||||
|
|
||||||
# To keep runtime good, just continue if something was changed
|
# To keep runtime good, just continue if something was changed
|
||||||
if ! $INPUT_DRY && _git_changed;
|
if _git_changed;
|
||||||
then
|
then
|
||||||
# Calling method to configure the git environemnt
|
if $INPUT_DRY; then
|
||||||
_git_setup
|
exit 1
|
||||||
echo "Commiting and pushing changes..."
|
else
|
||||||
# Switch to the actual branch
|
# Calling method to configure the git environemnt
|
||||||
git checkout $INPUT_BRANCH || echo "Problem checking out the specified branch: $INPUT_BRANCH"
|
_git_setup
|
||||||
# Add changes to git
|
echo "Commiting and pushing changes..."
|
||||||
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"
|
# Switch to the actual branch
|
||||||
# Commit and push changes back
|
git checkout $INPUT_BRANCH || echo "Problem checking out the specified branch: $INPUT_BRANCH"
|
||||||
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"}
|
# Add changes to git
|
||||||
_git_push
|
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"
|
||||||
echo "Changes pushed successfully."
|
# Commit and push changes back
|
||||||
|
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"}
|
||||||
|
_git_push
|
||||||
|
echo "Changes pushed successfully."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Nothing to commit. Exiting."
|
echo "Nothing to commit. Exiting."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user