@@ -239,6 +239,28 @@ jobs:
239239 git clone --depth 1 --branch ${{ matrix.version }} https://github.com/argoproj/argo-workflows.git
240240 cd argo-workflows
241241
242+ - name : Detect Go version from upstream Dockerfile
243+ id : go-version
244+ run : |
245+ cd argo-workflows
246+ # Extract Go version from upstream Dockerfile
247+ GO_IMAGE=$(grep -E '^ARG GOLANG_IMAGE=' Dockerfile | head -1 | cut -d= -f2)
248+
249+ if [ -z "$GO_IMAGE" ]; then
250+ # Fallback: try to extract from FROM golang line
251+ GO_IMAGE=$(grep -E '^FROM golang:' Dockerfile | head -1 | awk '{print $2}' | sed 's/FROM //' | sed 's/ as.*//')
252+ fi
253+
254+ if [ -z "$GO_IMAGE" ]; then
255+ # Default fallback
256+ GO_IMAGE="golang:1.25.6-alpine3.23"
257+ echo "⚠️ Could not detect Go version from Dockerfile, using default: $GO_IMAGE"
258+ else
259+ echo "✅ Detected Go version from upstream: $GO_IMAGE"
260+ fi
261+
262+ echo "golang_image=$GO_IMAGE" >> $GITHUB_OUTPUT
263+
242264 - name : Replace Dockerfile with FIPS version
243265 run : |
244266 cd argo-workflows
@@ -326,6 +348,7 @@ jobs:
326348 --cache-from "type=local,src=/tmp/.buildx-cache-fips" \
327349 --cache-to "type=local,dest=/tmp/.buildx-cache-fips-new,mode=max" \
328350 --output "type=image,push=true" \
351+ --build-arg GOLANG_IMAGE=${{ steps.go-version.outputs.golang_image }} \
329352 --build-arg GIT_COMMIT=$GIT_COMMIT \
330353 --build-arg GIT_TAG=$GIT_TAG \
331354 --build-arg GIT_TREE_STATE=$GIT_TREE_STATE \
0 commit comments