From cdb6100edac95653f5c02f7fe76e62c3ffb2c75b Mon Sep 17 00:00:00 2001 From: dlevy-msft-sql Date: Thu, 18 Jun 2026 22:31:06 +0000 Subject: [PATCH] ci: support variant-prefixed devcontainer Go tags The devcontainer-version-check workflow extracts the Go version from the base image tag in .devcontainer/Dockerfile. The previous regex only matched the legacy '.-bookworm' tag and failed on the new variant-prefixed tags published on mcr.microsoft.com (e.g. '2-1.26-bookworm'), causing the job to exit with 'Could not parse versions'. Allow an optional leading '-' variant prefix so both tag forms are accepted. --- .github/workflows/devcontainer-check.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devcontainer-check.yml b/.github/workflows/devcontainer-check.yml index fdcbe6aa..f9a3cf5a 100644 --- a/.github/workflows/devcontainer-check.yml +++ b/.github/workflows/devcontainer-check.yml @@ -23,8 +23,10 @@ jobs: GOMOD_VERSION=$(grep '^go ' go.mod | awk '{print $2}') GOMOD_MAJOR_MINOR=$(echo "$GOMOD_VERSION" | grep -oE '^[0-9]+\.[0-9]+') - # Extract the Go version from the Dockerfile base image tag - DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile) + # Extract the Go version from the Dockerfile base image tag. + # Accept both the legacy form (go:1.26-bookworm) and the variant-prefixed + # form (go:2-1.26-bookworm) published on mcr.microsoft.com. + DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:(?:[0-9]+-)?\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile) echo "go.mod requires: go ${GOMOD_VERSION} (major.minor: ${GOMOD_MAJOR_MINOR})" echo "Dockerfile base image: go:${DOCKERFILE_TAG}"