File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -77,18 +77,24 @@ jobs:
77
77
id : version
78
78
shell : bash
79
79
run : |
80
+ set -x
81
+
80
82
LINUX_URL=https://cdn.kernel.org/pub/linux/kernel
81
83
VERSION="${{ inputs.version }}"
82
84
first_char=${VERSION:0:1}
83
85
last_char=${VERSION: -1:1}
84
86
if [ $last_char == y ]; then
85
87
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
92
98
fi
93
99
94
100
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments