File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ Add a step like this to your workflow:
44
44
# Default: ''
45
45
remove : " ./dir/old_file.js"
46
46
47
+ # Name of the tag to add to the new commit. Use an empty string to disable tagging.
48
+ # Default: ''
49
+ tag : " v1.0.0"
50
+
47
51
env :
48
52
# This is necessary in order to push a commit to the repo
49
53
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ inputs:
31
31
description : Arguments for the git rm command
32
32
required : false
33
33
default : " "
34
+ tag :
35
+ description : The name of the tag to add to the new commit
36
+ required : false
37
+ default : " "
34
38
35
39
runs :
36
40
using : node12
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ remove() {
31
31
if [ -n " $INPUT_REMOVE " ]; then git rm $INPUT_REMOVE ; fi
32
32
}
33
33
34
+ tag () {
35
+ if [ -n " $INPUT_TAG " ]; then git tag $INPUT_TAG ; fi
36
+ }
37
+
34
38
# This is needed to make the check work for untracked files
35
39
echo " Staging files..."
36
40
add
@@ -68,8 +72,11 @@ if ! git diff --cached --quiet --exit-code; then
68
72
echo " Creating commit..."
69
73
git commit -m " $INPUT_MESSAGE " --author=" $INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL >"
70
74
75
+ echo " Tagging commit..."
76
+ tag
77
+
71
78
echo " Pushing to repo..."
72
- git push --set-upstream origin " $INPUT_REF "
79
+ git push --set-upstream origin " $INPUT_REF " --tags
73
80
74
81
echo " ::endgroup::"
75
82
echo " Task completed."
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ remove() {
31
31
if [ -n " $INPUT_REMOVE " ]; then git rm $INPUT_REMOVE ; fi
32
32
}
33
33
34
+ tag () {
35
+ if [ -n " $INPUT_TAG " ]; then git tag $INPUT_TAG ; fi
36
+ }
37
+
34
38
# This is needed to make the check work for untracked files
35
39
echo " Staging files..."
36
40
add
@@ -68,8 +72,11 @@ if ! git diff --cached --quiet --exit-code; then
68
72
echo " Creating commit..."
69
73
git commit -m " $INPUT_MESSAGE " --author=" $INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL >"
70
74
75
+ echo " Tagging commit..."
76
+ tag
77
+
71
78
echo " Pushing to repo..."
72
- git push --set-upstream origin " $INPUT_REF "
79
+ git push --set-upstream origin " $INPUT_REF " --tags
73
80
74
81
echo " ::endgroup::"
75
82
echo " Task completed."
You can’t perform that action at this time.
0 commit comments