Skip to content

Commit b786eaa

Browse files
committed
verbose shell output in kernel version step
1 parent 2ab6908 commit b786eaa

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/build2.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,24 @@ jobs:
7777
id: version
7878
shell: bash
7979
run: |
80+
set -x
81+
8082
LINUX_URL=https://cdn.kernel.org/pub/linux/kernel
8183
VERSION="${{ inputs.version }}"
8284
first_char=${VERSION:0:1}
8385
last_char=${VERSION: -1:1}
8486
if [ $last_char == y ]; then
8587
major_minor=${VERSION: 0:-1}
86-
VERSION=$(curl -s $LINUX_URL/v${first_char}.x/ \
87-
| sed -e 's/<[^>]*>//g' \
88-
| grep -oP "linux-${major_minor}[0-9]+" \
89-
| sort -r -V \
90-
| head -n1 \
91-
| cut -d '-' -f2)
88+
89+
# We do this in multiple steps instead of a chain of pipes to make debugging easier
90+
TMP=$(curl -s $LINUX_URL/v${first_char}.x/)
91+
TMP=$(echo $TMP | sed -e 's/<[^>]*>//g')
92+
TMP=$(echo $TMP | grep -oP "linux-${major_minor}[0-9]+")
93+
TMP=$(echo $TMP | sort -r -V)
94+
TMP=$(echo $TMP | head -n1)
95+
TMP=$(echo $TMP | cut -d '-' -f2)
96+
97+
VERSION=$TMP
9298
fi
9399
94100
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)