File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
- name : Push directory to another repository
1
+ name : Push directory to another repository and create a named tag
2
2
description : >-
3
3
Useful to push files to another repository to be used, for example, via github
4
4
pages
@@ -48,6 +48,10 @@ inputs:
48
48
description : ' [Optional] The directory to wipe and replace in the target repository'
49
49
default : ' '
50
50
required : false
51
+ tag-name :
52
+ description : ' [Optional] Add a tag to the commit'
53
+ default : ' '
54
+ required : false
51
55
create-target-branch-if-needed :
52
56
type : boolean
53
57
description : >-
71
75
- ' ${{ inputs.commit-message }}'
72
76
- ' ${{ inputs.target-directory }}'
73
77
- ' ${{ inputs.create-target-branch-if-needed }}'
78
+ - ' ${{ inputs.tag-name }}'
74
79
branding :
75
80
icon : git-commit
76
81
color : green
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ TARGET_BRANCH="${9}"
16
16
COMMIT_MESSAGE=" ${10} "
17
17
TARGET_DIRECTORY=" ${11} "
18
18
CREATE_TARGET_BRANCH_IF_NEEDED=" ${12} "
19
+ TAG_NAME=" ${13} "
19
20
20
21
if [ -z " $DESTINATION_REPOSITORY_USERNAME " ]
21
22
then
@@ -170,6 +171,12 @@ echo "[+] git diff-index:"
170
171
# git diff-index : to avoid doing the git commit failing if there are no changes to be commit
171
172
git diff-index --quiet HEAD || git commit --message " $COMMIT_MESSAGE "
172
173
174
+ if [ -n " ${TAG_NAME} " ]
175
+ then
176
+ git tag -a $TAG_NAME -m " "
177
+ git config --global push.followTags true
178
+ fi
179
+
173
180
echo " [+] Pushing git commit"
174
181
# --set-upstream: sets de branch when pushing to a branch that does not exist
175
182
git push " $GIT_CMD_REPOSITORY " --set-upstream " $TARGET_BRANCH "
You can’t perform that action at this time.
0 commit comments