@@ -251,19 +251,20 @@ jobs:
251251 cache-from : type=gha,scope=production
252252 cache-to : type=gha,mode=max,scope=production
253253
254- # Verify OpenSSL version in PRODUCTION stage (not builder or runtime-deps).
255- # Confirms dependencies were rebuilt AND are present in final distroless image.
256- - name : Verify OpenSSL in production image
254+ # Verify Node.js runtime crypto via OpenSSL binding in PRODUCTION stage.
255+ # Confirms the Node runtime has OpenSSL linked (critical for TLS/HTTPS).
256+ # Uses Node's built-in binding instead of CLI tool (distroless has no CLI tools).
257+ - name : Verify Node.js runtime crypto
257258 run : |
258259 IMAGE_NAME="fieldtrack-backend:${{ steps.meta.outputs.sha_short }}"
259- # Run against production image (distroless) — would fail if deps layer missed rebuild
260- OPENSSL_VERSION=$(docker run --rm "$IMAGE_NAME" openssl version 2>&1)
261- if [ $? -ne 0 ] || [ -z "$OPENSSL_VERSION" ]; then
262- echo "::error::OpenSSL check failed — dependencies were not rebuilt or not copied to production stage "
260+ OPENSSL_VERSION=$(docker run --rm "$IMAGE_NAME" node -p "process.versions.openssl" 2>&1)
261+ EXIT_CODE=$?
262+ if [ $EXIT_CODE -ne 0 ] || [ -z "$OPENSSL_VERSION" ]; then
263+ echo "::error::Node.js OpenSSL binding check failed"
263264 echo "Output: $OPENSSL_VERSION"
264265 exit 1
265266 fi
266- echo "✓ Production image verified: $OPENSSL_VERSION"
267+ echo "✓ Runtime crypto verified: OpenSSL $OPENSSL_VERSION"
267268
268269 # Capture the content-addressable image digest.
269270 # With cache scoping and cache busting, digest should always reproduce correctly.
0 commit comments