Skip to main content

이 버전의 GitHub Enterprise Server는 다음 날짜에 중단됩니다. 2024-06-29. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

SBOM(소프트웨어 자료 청구서)에 대한 REST API 엔드포인트

REST API를 사용하여 리포지토리에 대한 SBOM(소프트웨어 제품 구성 정보)을 내보냅니다.

리포지토리에 대한 최소한의 읽기 권한이 있는 경우 GitHub UI 또는 GitHub REST API를 통해 리포지토리에 대한 종속성 그래프를 SPDX 호환 SBOM(Software Bill of Materials)으로 내보낼 수 있습니다. 자세한 내용은 “리포지토리에 대한 소프트웨어 자료 청구서 내보내기”을 참조하세요.

이 문서에서는 REST API 엔드포인트에 대한 세부 정보를 제공합니다.

Export a software bill of materials (SBOM) for a repository.

Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.

"Export a software bill of materials (SBOM) for a repository."에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, Type, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

"Export a software bill of materials (SBOM) for a repository."에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Forbidden

404

Resource not found

"Export a software bill of materials (SBOM) for a repository."에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/dependency-graph/sbom
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/dependency-graph/sbom

Response

Status: 200
{ "sbom": { "SPDXID": "SPDXRef-DOCUMENT", "spdxVersion": "SPDX-2.3", "creationInfo": { "created": "2021-09-01T00:00:00Z", "creators": [ "Tool: GitHub.com-Dependency-Graph" ] }, "name": "github/example", "dataLicense": "CC0-1.0", "documentDescribes": [ "github/example" ], "documentNamespace": "https://github.com/github/example/dependency_graph/sbom-abcdef123456", "packages": [ { "SPDXID": "SPDXRef-Package", "name": "rubygems:rails", "versionInfo": "1.0.0", "downloadLocation": "NOASSERTION", "filesAnalyzed": false, "licenseConcluded": "NOASSERTION", "licenseDeclared": "NOASSERTION" } ] } }