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

종속성 검토에 대한 REST API 엔드포인트

REST API를 사용하여 종속성 변경 내용과 상호 작용합니다.

종속성 검토 정보

REST API를 사용하면 환경에 추가하기 전에 종속성 변경 내용 및 이러한 변경 내용이 보안에 미치는 영향을 확인할 수 있습니다. 알려진 취약점이 있는 버전 업데이트에 대한 취약점 데이터를 포함하여 리포지토리의 두 커밋 간의 종속성의 차이를 볼 수 있습니다. 종속성 검토에 대한 자세한 정보는 “종속성 검토 정보”을(를) 참조하세요.

Get a diff of the dependencies between commits

Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.

"Get a diff of the dependencies between commits"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • contents:read and pull_requests:read

공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.

"Get a diff of the dependencies between commits"에 대한 매개 변수

헤더
이름, 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.

basehead string Required

The base and head Git revisions to compare. The Git revisions will be resolved to commit SHAs. Named revisions will be resolved to their corresponding HEAD commits, and an appropriate merge base will be determined. This parameter expects the format {base}...{head}.

쿼리 매개 변수
이름, Type, 설명
name string

The full path, relative to the repository root, of the dependency manifest file.

"Get a diff of the dependencies between commits"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Response if GitHub Advanced Security is not enabled for this repository

404

Resource not found

"Get a diff of the dependencies between commits"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/dependency-graph/compare/{basehead}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/dependency-graph/compare/BASEHEAD

Response

Status: 200
[ { "change_type": "removed", "manifest": "package.json", "ecosystem": "npm", "name": "helmet", "version": "4.6.0", "package_url": "pkg:npm/helmet@4.6.0", "license": "MIT", "source_repository_url": "https://github.com/helmetjs/helmet", "vulnerabilities": [] }, { "change_type": "added", "manifest": "package.json", "ecosystem": "npm", "name": "helmet", "version": "5.0.0", "package_url": "pkg:npm/helmet@5.0.0", "license": "MIT", "source_repository_url": "https://github.com/helmetjs/helmet", "vulnerabilities": [] }, { "change_type": "added", "manifest": "Gemfile", "ecosystem": "rubygems", "name": "ruby-openid", "version": "2.7.0", "package_url": "pkg:gem/ruby-openid@2.7.0", "license": null, "source_repository_url": "https://github.com/openid/ruby-openid", "vulnerabilities": [ { "severity": "critical", "advisory_ghsa_id": "GHSA-fqfj-cmh6-hj49", "advisory_summary": "Ruby OpenID", "advisory_url": "https://github.com/advisories/GHSA-fqfj-cmh6-hj49" } ] } ]