mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-12 19:30:30 +02:00
Support not exiting the process in case of changes in dry mode (#122)
Co-authored-by: Conrad <grosserconrad@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9aba96f268
commit
4bd40fc486
@@ -79,8 +79,12 @@ if _git_changed; then
|
||||
if $INPUT_DRY; then
|
||||
echo "Unpretty Files Changes:"
|
||||
git diff
|
||||
echo "Finishing dry-run. Exiting before committing."
|
||||
exit 1
|
||||
if $INPUT_NO_COMMIT; then
|
||||
echo "There are changes that won't be commited, you can use an external job to do so."
|
||||
else
|
||||
echo "Finishing dry-run. Exiting before committing."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Calling method to configure the git environemnt
|
||||
_git_setup
|
||||
@@ -99,6 +103,11 @@ if _git_changed; then
|
||||
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"
|
||||
fi
|
||||
|
||||
if $INPUT_NO_COMMIT; then
|
||||
echo "There are changes that won't be commited, you can use an external job to do so."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Commit and push changes back
|
||||
if $INPUT_SAME_COMMIT; then
|
||||
echo "Amending the current commit..."
|
||||
|
||||
Reference in New Issue
Block a user