Skip to content

Commit

Permalink
Merge pull request #75 from insyri/dev
Browse files Browse the repository at this point in the history
Fix for #74
  • Loading branch information
creyD committed Dec 6, 2021
2 parents 9accc7b + f449610 commit 2b5c9a8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion entrypoint.sh
Expand Up @@ -113,14 +113,23 @@ 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..."
git pull
git commit --amend --no-edit
git push origin -f
else
git commit -m "$INPUT_COMMIT_MESSAGE" if [ "$INPUT_COMMIT_DESCRIPTION" != "" ]; then echo '-m "$INPUT_COMMIT_DESCRIPTION"' fi --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"} || echo "No files added to commit"
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"
git push origin ${INPUT_PUSH_OPTIONS:-}
fi
echo "Changes pushed successfully."
Expand Down

0 comments on commit 2b5c9a8

Please sign in to comment.