Skip to content

Commit

Permalink
feat: Add commitMessage option
Browse files Browse the repository at this point in the history
Close #74
cf. #72 and #73
  • Loading branch information
peaceiris committed Jan 6, 2020
1 parent fd02997 commit 08937a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ inputs:
useremail:
description: 'Set Git user.email'
required: false
commitMessage:
description: 'Set custom commit message'
required: false
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,16 @@ git add --all

print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"

if [ -n "${INPUT_COMMITMESSAGE}" ]; then
BASE_COMMIT_MESSAGE="${INPUT_COMMITMESSAGE}"
else
BASE_COMMIT_MESSAGE="Automated deployment: $(date -u)"
fi

if [ -n "${EXTERNAL_REPOSITORY}" ]; then
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
else
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_SHA}"
fi

if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
Expand Down

0 comments on commit 08937a7

Please sign in to comment.