Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #74 #75

Merged
merged 2 commits into from Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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