mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 06:33:17 +08:00
feat: Add tagOverwrite option
This commit is contained in:
parent
0f98ab44f5
commit
ee5987d184
@ -35,3 +35,7 @@ inputs:
|
||||
tagMessage:
|
||||
description: 'Set tag message'
|
||||
required: false
|
||||
tagOverwrite:
|
||||
description: 'Enable overwriting tag'
|
||||
required: false
|
||||
default: false
|
||||
|
@ -144,13 +144,20 @@ 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
|
||||
print_info "Tag message: ${INPUT_TAGMESSAGE}"
|
||||
git tag "${INPUT_TAGNAME}" -m "${INPUT_TAGMESSAGE}"
|
||||
GIT_TAG_MESSAGE="${INPUT_TAGMESSAGE}"
|
||||
else
|
||||
git tag "${INPUT_TAGNAME}"
|
||||
GIT_TAG_MESSAGE="Deployment ${INPUT_TAGNAME}"
|
||||
fi
|
||||
git push origin "${INPUT_TAGNAME}"
|
||||
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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user