Skip to content

Commit 57071d8

Browse files
authored
Merge pull request #1912 from o1-labs/copilot/fix-version-regex-test-docker-build-info
CI: fix version regex to accept variable-length commit hashes
2 parents a0697c9 + e4075ad commit 57071d8

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-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

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
- **CI**: add beta channel lint workflow to catch build issues early
2222
([#1875](https://github.com/o1-labs/mina-rust/pull/1875))
2323

24+
### Fixed
25+
26+
- **CI**: fix version regex in build verification workflows to accept
27+
variable-length commit hashes (7+ characters) instead of exactly 7, adapting
28+
to Git's dynamic abbreviation based on repository size, fix
29+
[#1911](https://github.com/o1-labs/mina-rust/issues/1911)
30+
([#1912](https://github.com/o1-labs/mina-rust/pull/1912))
31+
2432
### Changes
2533

2634
- **Dependencies**: vendor redux-rs into `vendor/redux` to centralize all code

0 commit comments

Comments
 (0)