Merged the input commit description if statement

This commit is contained in:
2021-12-06 12:18:46 +01:00
committed by GitHub
parent fdbbee3567
commit 86625cc217

View File

@@ -113,15 +113,6 @@ if _git_changed; then
git add "${INPUT_FILE_PATTERN}" || echo "Problem adding your files with pattern ${INPUT_FILE_PATTERN}"
fi
# Check if the commit description was populated
IF_COMMIT_DESC=""
if [ "$INPUT_COMMIT_DESCRIPTION" != "" ]
then
IF_COMMIT_DESC=" -m '$INPUT_COMMIT_DESCRIPTION'"
else
IF_COMMIT_DESC=""
fi
# Commit and push changes back
if $INPUT_SAME_COMMIT; then
echo "Amending the current commit..."
@@ -129,7 +120,12 @@ if _git_changed; then
git commit --amend --no-edit
git push origin -f
else
git commit -m "$INPUT_COMMIT_MESSAGE" $IF_COMMIT_DESC --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit"
if [ "$INPUT_COMMIT_DESCRIPTION" != "" ]
then
git commit -m "$INPUT_COMMIT_MESSAGE" -m $INPUT_COMMIT_DESCRIPTION --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit"
else
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit"
fi
git push origin ${INPUT_PUSH_OPTIONS:-}
fi
echo "Changes pushed successfully."