Skip to content

Commit cf67988

Browse files
committed
fix(ci): use checksums-bsd for yq integrity verification
The checksums file from mikefarah/yq uses a custom multi-hash-per-line format that isn't compatible with sha256sum -c (which expects GNU coreutils format). Switched to checksums-bsd, which uses the standard BSD-style "SHA256 (file) = hash" layout; a small sed converts that to GNU format for verification.
1 parent 9f0fe12 commit cf67988

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/scripts/install-yq.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ BASE_URL="https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}"
1212
mkdir -p "$INSTALL_DIR"
1313

1414
wget -qO "$INSTALL_DIR/yq_linux_amd64" "${BASE_URL}/yq_linux_amd64"
15-
wget -qO "$INSTALL_DIR/checksums" "${BASE_URL}/checksums"
15+
wget -qO "$INSTALL_DIR/checksums-bsd" "${BASE_URL}/checksums-bsd"
1616

1717
(
1818
cd "$INSTALL_DIR"
19-
grep 'yq_linux_amd64$' checksums | sha256sum -c -
19+
# checksums-bsd uses BSD-style: SHA256 (yq_linux_amd64) = 0c4d965e...
20+
# sha256sum -c expects GNU-style: 0c4d965e... yq_linux_amd64
21+
# sed captures the filename (\1) and hash (\2), discarding "SHA256 (", ") = ",
22+
# then emits them in reversed order to match GNU format.
23+
grep 'SHA256 (yq_linux_amd64)' checksums-bsd \
24+
| sed 's/SHA256 (\(.*\)) = \(.*\)/\2 \1/' \
25+
| sha256sum -c -
2026
mv yq_linux_amd64 yq
21-
rm -f checksums
27+
rm -f checksums-bsd
2228
chmod +x yq
2329
)
2430

0 commit comments

Comments
 (0)