File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ The commit message to be used in the output repository. Optional and defaults to
35
35
36
36
The string ` ORIGIN_COMMIT ` is replaced by ` $REPOSITORY_URL@commit ` .
37
37
38
+ ### ` commit-tag ` (argument) [ optional]
39
+ Tags a commit.
40
+
38
41
### ` API_TOKEN_GITHUB ` (environment)
39
42
E.g.:
40
43
` API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} `
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ inputs:
25
25
description : ' [Optional] commit message for the output repository. ORIGIN_COMMIT is replaced by the URL@commit in the origin repo'
26
26
default : ' Update from ORIGIN_COMMIT'
27
27
required : false
28
+ commit-tag :
29
+ description : ' [Optional] Tag a commit'
30
+ default : ' None'
31
+ required : false
28
32
runs :
29
33
using : ' docker'
30
34
image : ' Dockerfile'
36
40
- ${{ inputs.destination-repository-username }}
37
41
- ${{ inputs.target-branch }}
38
42
- ${{ inputs.commit-message }}
43
+ - ${{ inputs.commit-tag }}
39
44
branding :
40
45
icon : ' git-commit'
41
46
color : ' green'
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ USER_EMAIL="$4"
11
11
DESTINATION_REPOSITORY_USERNAME=" $5 "
12
12
TARGET_BRANCH=" $6 "
13
13
COMMIT_MESSAGE=" $7 "
14
+ COMMIT_TAG=" $8 "
14
15
15
16
if [ -z " $DESTINATION_REPOSITORY_USERNAME " ]
16
17
then
@@ -48,5 +49,13 @@ git status
48
49
git diff-index --quiet HEAD || git commit --message " $COMMIT_MESSAGE "
49
50
50
51
echo " Pushing git commit"
51
- # --set-upstream: sets de branch when pushing to a branch that does not exist
52
+ # --set-upstream: sets the branch when pushing to a branch that does not exist
52
53
git push origin --set-upstream " $TARGET_BRANCH "
54
+
55
+ # tag the commit
56
+ if [ -z " $COMMIT_TAG " ]
57
+ then
58
+ echo " Tagging the commit"
59
+ git tag " $COMMIT_TAG "
60
+ git push origin --tags
61
+ fi
You can’t perform that action at this time.
0 commit comments