Skip to content

chore(deps): bump golang.org/x/sys in the golang-x group (#377) #8

chore(deps): bump golang.org/x/sys in the golang-x group (#377)

chore(deps): bump golang.org/x/sys in the golang-x group (#377) #8

Workflow file for this run

name: devcontainer
on:
pull_request:
branches:
- main
paths:
- '.devcontainer/**'
- '.dockerignore'
- '.github/workflows/devcontainer.yml'
- 'go.mod'
push:
branches:
- main
paths:
- '.devcontainer/**'
- '.dockerignore'
- '.github/workflows/devcontainer.yml'
- 'go.mod'
workflow_dispatch:
permissions: {}
jobs:
check-go-version-alignment:
name: Verify Go version alignment
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# actions/checkout v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Verify Dockerfile Go version satisfies go.mod
run: |
# Extract the major.minor Go version required by go.mod
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=$(sed -n 's/.*devcontainers\/go:\([0-9]*\.[0-9]*\).*/\1/p' .devcontainer/Dockerfile)
echo "go.mod requires: go ${GOMOD_VERSION} (major.minor: ${GOMOD_MAJOR_MINOR})"
echo "Dockerfile base image: go:${DOCKERFILE_TAG}"
if [[ -z "$GOMOD_MAJOR_MINOR" || -z "$DOCKERFILE_TAG" ]]; then
echo "ERROR: Could not parse versions"
exit 1
fi
if [[ "$GOMOD_MAJOR_MINOR" != "$DOCKERFILE_TAG" ]]; then
echo ""
echo "ERROR: Version mismatch!"
echo "The devcontainer base image (go:${DOCKERFILE_TAG}) does not match"
echo "the Go version required by go.mod (${GOMOD_MAJOR_MINOR})."
echo ""
echo "Update .devcontainer/Dockerfile:"
echo " FROM mcr.microsoft.com/devcontainers/go:${GOMOD_MAJOR_MINOR}-bookworm"
echo ""
echo "You may also need to update the pinned Go tool versions in the Dockerfile"
echo "(gopls, delve, staticcheck) to versions compatible with Go ${GOMOD_MAJOR_MINOR}."
exit 1
fi
echo "OK: Versions are aligned."
build:
name: Build devcontainer
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# actions/checkout v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Build devcontainer image
# devcontainers/ci v0.3
uses: devcontainers/ci@b63b30de439b47a52267f241112c5b453b673db5 # v0.3
with:
imageName: go-mssqldb-devcontainer
push: never