diff --git a/action.yml b/action.yml index 823ab7898..b569493d6 100644 --- a/action.yml +++ b/action.yml @@ -26,3 +26,6 @@ inputs: useremail: description: 'Set Git user.email' required: false + commitMessage: + description: 'Set custom commit message' + required: false diff --git a/entrypoint.sh b/entrypoint.sh index af3ad95c7..4efb3ad57 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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