Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77cc1b1

Browse files
authored
Merge pull request cli#10102 from malancas/more-attestation-cmd-integration-tests
Add more `gh attestation verify` integration tests
2 parents c23a283 + 81b837a commit 77cc1b1

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Get the root directory of the repository
5+
rootDir="$(git rev-parse --show-toplevel)"
6+
7+
ghBuildPath="$rootDir/bin/gh"
8+
9+
artifactPath="$rootDir/pkg/cmd/attestation/test/data/sigstore-js-2.1.0.tgz"
10+
bundlePath="$rootDir/pkg/cmd/attestation/test/data/sigstore-js-2.1.0_with_2_bundles.jsonl"
11+
12+
# Download a custom trusted root for verification
13+
if ! $ghBuildPath attestation trusted-root > trusted_root.jsonl; then
14+
# cleanup test data
15+
echo "Failed to download trusted root"
16+
exit 1
17+
fi
18+
19+
if ! $ghBuildPath attestation verify "$artifactPath" -b "$bundlePath" --digest-alg=sha512 --owner=sigstore --custom-trusted-root trusted_root.jsonl; then
20+
echo "Failed to verify package with a Sigstore v0.2.0 bundle"
21+
exit 1
22+
fi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Get the root directory of the repository
5+
rootDir="$(git rev-parse --show-toplevel)"
6+
7+
ghBuildPath="$rootDir/bin/gh"
8+
9+
ghCLIArtifact="$rootDir/pkg/cmd/attestation/test/data/gh_2.60.1_windows_arm64.zip"
10+
11+
# Verify the gh CLI artifact
12+
echo "Testing with package $ghCLIArtifact"
13+
if ! $ghBuildPath attestation verify "$ghCLIArtifact" --digest-alg=sha256 --owner=cli; then
14+
echo "Failed to verify"
15+
exit 1
16+
fi

0 commit comments

Comments
 (0)