Compare commits

...

3 Commits

Author SHA1 Message Date
peaceiris
ee5987d184 feat: Add tagOverwrite option 2020-01-13 09:01:05 +09:00
peaceiris
0f98ab44f5 feat: Add print_info for tag options 2020-01-13 00:53:19 +09:00
peaceiris
58f69047b6 feat: Add tagName and tagMessage options
Close #76
2020-01-13 00:34:43 +09:00
2 changed files with 28 additions and 0 deletions

View File

@@ -29,3 +29,13 @@ inputs:
commitMessage:
description: 'Set custom commit message'
required: false
tagName:
description: 'Set tag name'
required: false
tagMessage:
description: 'Set tag message'
required: false
tagOverwrite:
description: 'Enable overwriting tag'
required: false
default: false

View File

@@ -142,4 +142,22 @@ else
git push origin "${remote_branch}"
fi
if [[ -n "${INPUT_TAGNAME}" ]]; then
print_info "Tag name: ${INPUT_TAGNAME}"
print_info "Tag message: ${INPUT_TAGMESSAGE}"
print_info "Tag overwrite: ${INPUT_TAGOVERWRITE}"
if [[ -n "${INPUT_TAGMESSAGE}" ]]; then
GIT_TAG_MESSAGE="${INPUT_TAGMESSAGE}"
else
GIT_TAG_MESSAGE="Deployment ${INPUT_TAGNAME}"
fi
if [[ "${INPUT_TAGOVERWRITE}" == "true" ]]; then
GIT_TAG_OPTION="--force"
else
GIT_TAG_OPTION=""
fi
git tag "${GIT_TAG_OPTION}" -a "${INPUT_TAGNAME}" -m "${GIT_TAG_MESSAGE}"
git push "${GIT_TAG_OPTION}" origin "${INPUT_TAGNAME}"
fi
print_info "${GITHUB_SHA} was successfully deployed"