Skip to content

Commit 7724d35

Browse files
AdamSalehclaude
andcommitted
fix: pin codecov CLI version and verify checksum
Pin the codecov CLI download to a specific version (v11.2.8) and verify the SHA256 checksum before executing, addressing the supply-chain risk of fetching an unpinned "latest" binary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Adam Saleh <adam@asaleh.net>
1 parent 66f634e commit 7724d35

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/openshiftci-presubmit-unittests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ make test
3636
echo "Codecov token not found at ${CODECOV_TOKEN_FILE}, skipping upload"
3737
exit 0
3838
fi
39-
curl -OSs --fail-with-body https://cli.codecov.io/latest/linux/codecov
39+
CODECOV_VERSION="v11.2.8"
40+
CODECOV_SHA="8930c4bb30254a42f3d8c340706b1be340885e20c0df5160a24efa2e030e662b"
41+
curl -OSs --fail-with-body "https://cli.codecov.io/${CODECOV_VERSION}/linux/codecov"
42+
if ! echo "${CODECOV_SHA} codecov" | sha256sum --check --status; then
43+
echo "Codecov CLI checksum verification failed, aborting upload"
44+
exit 1
45+
fi
4046
chmod +x codecov
4147
CODECOV_TOKEN="$(cat "${CODECOV_TOKEN_FILE}")" ./codecov upload-process --flag unit-tests --file cover.out
4248
) || echo "Coverage upload to codecov.io failed, continuing"

0 commit comments

Comments
 (0)