Skip to content

Commit fcd1381

Browse files
properly redirect the pipe
1 parent 2e1581d commit fcd1381

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ jobs:
136136
cd .cache-build
137137
if [ ! -d "linux-${FULL_VERSION}" ]; then
138138
tar -xf ../linux-${FULL_VERSION}.tar.xz
139-
EXTRACTED_DIR=$(tar -tf ../linux-${FULL_VERSION}.tar.xz | head -1 | cut -f1 -d"/")
139+
# Find the extracted dir from the filesystem instead of re-running tar -tf,
140+
# which causes "stdout: write error" when piped to head (broken pipe).
141+
EXTRACTED_DIR=$(find . -maxdepth 1 -mindepth 1 -type d | head -1 | sed 's|^\./||')
140142
if [ "$EXTRACTED_DIR" != "linux-${FULL_VERSION}" ]; then
141143
mv "$EXTRACTED_DIR" "linux-${FULL_VERSION}"
142144
fi

0 commit comments

Comments
 (0)