Skip to content

Commit a16064d

Browse files
ci: support variant-prefixed devcontainer Go tags (#778)
Co-authored-by: dlevy-msft-sql <dlevy-msft-sql@users.noreply.github.com>
1 parent ec72ee2 commit a16064d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/devcontainer-check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ jobs:
2323
GOMOD_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
2424
GOMOD_MAJOR_MINOR=$(echo "$GOMOD_VERSION" | grep -oE '^[0-9]+\.[0-9]+')
2525
26-
# Extract the Go version from the Dockerfile base image tag
27-
DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile)
26+
# Extract the Go version from the Dockerfile base image tag.
27+
# Accept both the legacy form (go:1.26-bookworm) and the variant-prefixed
28+
# form (go:2-1.26-bookworm) published on mcr.microsoft.com.
29+
DOCKERFILE_TAG=$(grep -oP 'devcontainers/go:(?:[0-9]+-)?\K[0-9]+\.[0-9]+' .devcontainer/Dockerfile)
2830
2931
echo "go.mod requires: go ${GOMOD_VERSION} (major.minor: ${GOMOD_MAJOR_MINOR})"
3032
echo "Dockerfile base image: go:${DOCKERFILE_TAG}"

0 commit comments

Comments
 (0)