Skip to content

Commit 3a55e2a

Browse files
directcuteodannywillems
authored andcommitted
CI/docker: accept version tags in build-info validation
The test-docker-build-info job was only accepting 7-character commit hashes, causing failures for tagged releases where the version is set to the tag name (e.g., v0.18.0). Update the validation regex to accept both commit hashes and semantic version tags (vX.Y.Z).
1 parent b6e9dd6 commit 3a55e2a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/docker.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ jobs:
279279
# Verify required fields are present
280280
docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
281281
282-
# Verify version format
282+
# Verify version format (commit hash or version tag)
283283
VERSION=$(docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep "Version:" | awk '{print $2}')
284-
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
285-
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
284+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]] && [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
285+
echo "Error: Version should be either a 7-character commit hash or a version tag (vX.Y.Z), got: $VERSION"
286286
exit 1
287287
fi
288288

0 commit comments

Comments
 (0)