File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,7 @@ inputs:
35
35
tagMessage :
36
36
description : ' Set tag message'
37
37
required : false
38
+ tagOverwrite :
39
+ description : ' Enable overwriting tag'
40
+ required : false
41
+ default : false
Original file line number Diff line number Diff line change 144
144
145
145
if [[ -n " ${INPUT_TAGNAME} " ]]; then
146
146
print_info " Tag name: ${INPUT_TAGNAME} "
147
+ print_info " Tag message: ${INPUT_TAGMESSAGE} "
148
+ print_info " Tag overwrite: ${INPUT_TAGOVERWRITE} "
147
149
if [[ -n " ${INPUT_TAGMESSAGE} " ]]; then
148
- print_info " Tag message: ${INPUT_TAGMESSAGE} "
149
- git tag " ${INPUT_TAGNAME} " -m " ${INPUT_TAGMESSAGE} "
150
+ GIT_TAG_MESSAGE=" ${INPUT_TAGMESSAGE} "
150
151
else
151
- git tag " ${INPUT_TAGNAME} "
152
+ GIT_TAG_MESSAGE= " Deployment ${INPUT_TAGNAME} "
152
153
fi
153
- git push origin " ${INPUT_TAGNAME} "
154
+ if [[ " ${INPUT_TAGOVERWRITE} " == " true" ]]; then
155
+ GIT_TAG_OPTION=" --force"
156
+ else
157
+ GIT_TAG_OPTION=" "
158
+ fi
159
+ git tag " ${GIT_TAG_OPTION} " -a " ${INPUT_TAGNAME} " -m " ${GIT_TAG_MESSAGE} "
160
+ git push " ${GIT_TAG_OPTION} " origin " ${INPUT_TAGNAME} "
154
161
fi
155
162
156
163
print_info " ${GITHUB_SHA} was successfully deployed"
You can’t perform that action at this time.
0 commit comments