mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-15 12:50:31 +02:00
feat: allow action to use current commit instead of creating a new one
This commit is contained in:
@@ -53,7 +53,12 @@ then
|
||||
# Add changes to git
|
||||
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"
|
||||
# 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"}
|
||||
if $INPUT_SAME_COMMIT; then
|
||||
echo "Amending the current commit..."
|
||||
git commit --amend --no-edit
|
||||
else
|
||||
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"}
|
||||
fi
|
||||
git push origin
|
||||
echo "Changes pushed successfully."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user