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
22description : >-
33 Useful to push files to another repository to be used, for example, via github
44 pages
@@ -48,6 +48,10 @@ inputs:
4848 description : ' [Optional] The directory to wipe and replace in the target repository'
4949 default : ' '
5050 required : false
51+ tag-name :
52+ description : ' [Optional] Add a tag to the commit'
53+ default : ' '
54+ required : false
5155 create-target-branch-if-needed :
5256 type : boolean
5357 description : >-
7175 - ' ${{ inputs.commit-message }}'
7276 - ' ${{ inputs.target-directory }}'
7377 - ' ${{ inputs.create-target-branch-if-needed }}'
78+ - ' ${{ inputs.tag-name }}'
7479branding :
7580 icon : git-commit
7681 color : green
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ TARGET_BRANCH="${9}"
1616COMMIT_MESSAGE=" ${10} "
1717TARGET_DIRECTORY=" ${11} "
1818CREATE_TARGET_BRANCH_IF_NEEDED=" ${12} "
19+ TAG_NAME=" ${13} "
1920
2021if [ -z " $DESTINATION_REPOSITORY_USERNAME " ]
2122then
@@ -170,6 +171,12 @@ echo "[+] git diff-index:"
170171# git diff-index : to avoid doing the git commit failing if there are no changes to be commit
171172git diff-index --quiet HEAD || git commit --message " $COMMIT_MESSAGE "
172173
174+ if [ -n " ${TAG_NAME} " ]
175+ then
176+ git tag -a $TAG_NAME -m " "
177+ git config --global push.followTags true
178+ fi
179+
173180echo " [+] Pushing git commit"
174181# --set-upstream: sets de branch when pushing to a branch that does not exist
175182git push " $GIT_CMD_REPOSITORY " --set-upstream " $TARGET_BRANCH "
You can’t perform that action at this time.
0 commit comments