Skip to content

Commit f6dd8e4

Browse files
committed
Improve check-tag-format script
1 parent 236101d commit f6dd8e4

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/scripts/check-tag-format.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
# Checking if current tag matches the required formating
44
is_pre_release=$1
5-
65
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | tr -d ' ',v)
76

87
if [ $is_pre_release = false ]; then
8+
# Works with the format vX.X.X
9+
#
10+
# Example of correct format:
11+
# v0.1.0
912
echo "$current_tag" | grep -E "[0-9]*\.[0-9]*\.[0-9]*$"
1013
if [ $? != 0 ]; then
11-
echo "Your tag is badly formatted for a none pre-release"
14+
echo "Error: Your tag: $current_tag is wrongly formatted."
15+
echo "Please refer to the contributing guide for help."
1216
exit 1
1317
fi
1418
exit 0
@@ -18,14 +22,15 @@ if [ $is_pre_release = true ]; then
1822
# Works with the format vX.X.X-xxx-beta.X
1923
# none or multiple -xxx are valid
2024
#
21-
# Exemple of correct format
22-
# vX.X.X-beta.0
23-
# vX.X.X-xxx-beta.0
24-
# vX.X.X-xxx-xxx-beta.0
25+
# Examples of correct format:
26+
# v0.1.0-beta.0
27+
# v0.1.0-xxx-beta.0
28+
# v0.1.0-xxx-xxx-beta.0
2529
echo "$current_tag" | grep -E "[0-9]*\.[0-9]*\.[0-9]*-([a-z]*-)*beta\.[0-9]*$"
2630

2731
if [ $? != 0 ]; then
28-
echo "Your pre release tag: $current_tag is badly formatted. Please refer to contributing guide"
32+
echo "Error: Your beta tag: $current_tag is wrongly formatted."
33+
echo "Please refer to the contributing guide for help."
2934
exit 1
3035
fi
3136
exit 0

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ Here are the steps to release a beta version of this package:
138138
- Create a new branch containing the "beta" changes with the following format `xxx-beta` where `xxx` explains the context.
139139

140140
For example:
141-
- When implementing a beta feature create a branch `my-feature-beta` where you implement the feature.
141+
- When implementing a beta feature, create a branch `my-feature-beta` where you implement the feature.
142142
```bash
143143
git checkout -b my-feature-beta
144144
```
145-
- During the Meilisearch pre-release create a branch originating from `bump-meilisearch-v*.*.*` named `meilisearch-v*.*.*-beta`. <br>
145+
- During the Meilisearch pre-release, create a branch originating from `bump-meilisearch-v*.*.*` named `meilisearch-v*.*.*-beta`. <br>
146146
`v*.*.*` is the next version of the package, NOT the version of Meilisearch!
147147

148148
```bash

0 commit comments

Comments
 (0)