@@ -111,15 +111,14 @@ jobs:
111111
112112 - name : Bundle (${{ matrix.docker-platform }}
113113 run : |
114- docker run --rm -v ${{ github.workspace }}:/work -w /work \
114+ docker run --rm -t - v ${{ github.workspace }}:/work -w /work \
115115 --platform ${{ matrix.docker-platform }} \
116116 node:18-buster \
117117 /bin/bash -c '
118118 set -ex
119119
120- echo 'deb http://archive.debian.org/debian buster main' > /etc/apt/sources.list
121- echo 'deb http://archive.debian.org/debian-security buster/updates main' >> /etc/apt/sources.list
122- # We must ignore the 'valid-until' check because these archives are old
120+ echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
121+ echo "deb http://archive.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list
123122 apt-get -o Acquire::Check-Valid-Until=false update
124123
125124 apt-get update
@@ -143,26 +142,19 @@ jobs:
143142 npm run bundle:prod
144143 fi
145144
146- FOUND_FILES=0
147- # Find all .node files recursively and loop through them
148- find . -name "*.node" -print0 | while IFS= read -r -d '' file; do
149- FOUND_FILES=1
150- echo "Inspecting $file..."
151-
152- # Check for the forbidden symbol
153- if strings "$file" | grep -q "GLIBCXX_3.4.29"; then
154- echo "::error::File $file is linked against GLIBCXX_3.4.29 (Too new for old Linux)"
155- fi
156-
157- # Print the newest GLIBCXX version found in this file for logging
158- MAX_VER=$(strings "$file" | grep GLIBCXX | sort -V | tail -n 1)
159- echo " > Clean. Max GLIBCXX version: $MAX_VER"
160- done
161-
162- if [ "$FOUND_FILES" -eq 0 ]; then
163- echo "::warning::No .node files found to check"
145+ # Check if files exist first
146+ if [ -z "$(find . -name "*.node" -print -quit)" ]; then
147+ echo "::warning::No .node files found to check"
164148 else
165- echo "All detected .node files are safe."
149+ find . -name "*.node" -print0 | while IFS= read -r -d "" file; do
150+ echo "Inspecting $file..."
151+ if strings "$file" | grep -q "GLIBCXX_3.4.29"; then
152+ echo "::error::File $file linked against GLIBCXX_3.4.29"
153+ exit 1
154+ fi
155+ MAX=$(strings "$file" | grep GLIBCXX | sort -V | tail -n 1)
156+ echo " > OK. Max GLIBCXX: $MAX"
157+ done
166158 fi
167159
168160 GOARCH=${{ matrix.go-arch }} go build -C ./cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init
0 commit comments