Skip to content

Commit 8cc28e4

Browse files
authored
Merge branch 'main' into feat/slack-bridge
2 parents f44fdce + c8a82f6 commit 8cc28e4

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/install-openshell.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,23 @@ esac
7979
tmpdir="$(mktemp -d)"
8080
trap 'rm -rf "$tmpdir"' EXIT
8181

82+
CHECKSUM_FILE="openshell-checksums-sha256.txt"
8283
if command -v gh >/dev/null 2>&1; then
8384
GH_TOKEN="${GITHUB_TOKEN:-}" gh release download --repo NVIDIA/OpenShell \
8485
--pattern "$ASSET" --dir "$tmpdir"
86+
GH_TOKEN="${GITHUB_TOKEN:-}" gh release download --repo NVIDIA/OpenShell \
87+
--pattern "$CHECKSUM_FILE" --dir "$tmpdir"
8588
else
8689
curl -fsSL "https://github.com/NVIDIA/OpenShell/releases/latest/download/$ASSET" \
8790
-o "$tmpdir/$ASSET"
91+
curl -fsSL "https://github.com/NVIDIA/OpenShell/releases/latest/download/$CHECKSUM_FILE" \
92+
-o "$tmpdir/$CHECKSUM_FILE"
8893
fi
8994

95+
info "Verifying SHA-256 checksum..."
96+
(cd "$tmpdir" && grep -F "$ASSET" "$CHECKSUM_FILE" | shasum -a 256 -c -) \
97+
|| fail "SHA-256 checksum verification failed for $ASSET"
98+
9099
tar xzf "$tmpdir/$ASSET" -C "$tmpdir"
91100

92101
target_dir="/usr/local/bin"

test/runner.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,11 @@ describe("regression guards", () => {
293293
expect(line.includes("NVIDIA_API_KEY")).toBe(false);
294294
}
295295
});
296+
297+
it("install-openshell.sh verifies OpenShell binary checksum after download", () => {
298+
const src = fs.readFileSync(path.join(import.meta.dirname, "..", "scripts", "install-openshell.sh"), "utf-8");
299+
expect(src).toContain("openshell-checksums-sha256.txt");
300+
expect(src).toContain("shasum -a 256 -c");
301+
});
296302
});
297303
});

0 commit comments

Comments
 (0)