Skip to content

Commit a96b40f

Browse files
Copilotdannywillems
andcommitted
Fix version regex to accept variable-length commit hashes
Co-authored-by: dannywillems <6018454+dannywillems@users.noreply.github.com>
1 parent b6ce172 commit a96b40f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/build-reusable.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
6666
# Verify version format (should be a short commit hash)
6767
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
68-
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
69-
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
68+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7,}$ ]]; then
69+
echo "Error: Version should be a commit hash (7+ characters), got: $VERSION"
7070
exit 1
7171
fi
7272

.github/workflows/docker.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ jobs:
299299
300300
# Verify version format (commit hash or version tag)
301301
VERSION=$(docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep "Version:" | awk '{print $2}')
302-
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]] && [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
303-
echo "Error: Version should be either a 7-character commit hash or a version tag (vX.Y.Z), got: $VERSION"
302+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7,}$ ]] && [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
303+
echo "Error: Version should be either a commit hash (7+ characters) or a version tag (vX.Y.Z), got: $VERSION"
304304
exit 1
305305
fi
306306

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ jobs:
200200
201201
# Verify version format (should be a short commit hash)
202202
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
203-
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
204-
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
203+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7,}$ ]]; then
204+
echo "Error: Version should be a commit hash (7+ characters), got: $VERSION"
205205
exit 1
206206
fi
207207

0 commit comments

Comments
 (0)