gh attestation download
gh attestation download [<file-path> | oci://<image-uri>] [--owner | --repo] [flags]
注意:此功能目前处于测试阶段,可能会有所变化。
下载与工件关联的证明以供离线使用。
该命令需要
- 工件的文件路径,或
- 容器镜像 URI(例如
oci://<image-uri>)- (请注意,如果提供 OCI URL,则您必须已对其容器注册表进行身份验证)
此外,该命令需要
--repo标志(例如 --repo github/example)。--owner标志(例如 --owner github),或
--repo 标志值必须与工件链接的 GitHub 存储库的名称匹配。
--owner 标志值必须与工件链接的存储库所属的 GitHub 组织的名称匹配。
任何关联的捆绑包将写入当前目录中的一个文件,该文件以工件的摘要命名。例如,如果摘要是“sha256:1234”,则该文件将命名为“sha256:1234.jsonl”。
选项
-d,--digest-alg <string> (默认 "sha256")- 用于计算工件摘要的算法:{sha256|sha512}
-L,--limit <int> (默认 30)- 要获取的最大证明数量
-o,--owner <string>- 一个 GitHub 组织,用于通过它来限定证明查找范围
-
--predicate-type <string> - 根据提供的谓词类型筛选证明
-R,--repo <string>- 以 <owner>/<repo> 格式表示的存储库名称
示例
# Download attestations for a local artifact linked with an organization
$ gh attestation download example.bin -o github
# Download attestations for a local artifact linked with a repository
$ gh attestation download example.bin -R github/example
# Download attestations for an OCI image linked with an organization
$ gh attestation download oci://example.com/foo/bar:latest -o github