File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 106
106
Email of the git committer. Defaults to the GitHub Action bot's email.
107
107
default : " 41898282+github-actions[bot]@users.noreply.github.com"
108
108
type : string
109
+ tag_prefix :
110
+ description : |
111
+ The prefix to remove from the tag name to calculate the version.
112
+ For example, with prefix 'v' and tag 'v1.2.3', the version becomes '1.2.3'.
113
+ With prefix 'bazel-v' and tag 'bazel-v1.2.3', the version becomes '1.2.3'.
114
+ default : " v"
115
+ type : string
109
116
secrets :
110
117
publish_token :
111
118
required : true
@@ -135,12 +142,13 @@ jobs:
135
142
path : bazel-central-registry
136
143
persist-credentials : false
137
144
138
- # Get version from the tag, stripping any v- prefix
145
+ # Get version from the tag, stripping the specified prefix
139
146
- name : Write release version
140
147
env :
141
148
TAG : ${{ inputs.tag_name }}
149
+ PREFIX : ${{ inputs.tag_prefix }}
142
150
run : |
143
- VERSION=${TAG#v }
151
+ VERSION=${TAG#$PREFIX }
144
152
echo Version: $VERSION
145
153
echo "VERSION=$VERSION" >> $GITHUB_ENV
146
154
You can’t perform that action at this time.
0 commit comments