feat: allow action to use current commit instead of creating a new one

This commit is contained in:
jorenbroekema
2020-10-16 12:27:20 +02:00
parent ea3e74cc2d
commit 6ad77586cd
3 changed files with 13 additions and 1 deletions

View File

@@ -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