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

사용자 지정 속성에 대한 REST API 엔드포인트

REST API를 사용하여 조직에서 리포지토리에 할당된 사용자 지정 속성을 나열합니다.

사용자 지정 속성 정보

REST API를 사용하여 리포지토리를 소유한 조직에서 리포지토리에 할당된 사용자 지정 속성을 볼 수 있습니다. 자세한 내용은 "조직의 리포지토리에 대한 사용자 지정 속성 관리"을(를) 참조하세요. 사용자 지정 속성을 관리하는 REST API 엔드포인트에 대한 자세한 내용은 "사용자 지정 속성에 대한 REST API 엔드포인트.

Get all custom property values for a repository

Gets all custom property values that are set for a repository. Users with read access to the repository can use this endpoint.

"Get all custom property values for a repository"에 대한 세분화된 액세스 토큰

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

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

  • metadata:read

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

"Get all custom property values 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.

"Get all custom property values for a repository"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Forbidden

404

Resource not found

"Get all custom property values for a repository"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/properties/values
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/properties/values

Response

Status: 200
[ { "property_name": "environment", "value": "production" }, { "property_name": "service", "value": "web" }, { "property_name": "team", "value": "octocat" } ]

Create or update custom property values for a repository

Create new or update existing custom property values for a repository. Using a value of null for a custom property will remove or 'unset' the property value from the repository.

Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint.

"Create or update custom property values for a repository"에 대한 세분화된 액세스 토큰

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

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

  • repository_custom_properties:write

"Create or update custom property values 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.

본문 매개 변수
이름, Type, 설명
properties array of objects Required

A list of custom property names and associated values to apply to the repositories.

이름, Type, 설명
property_name string Required

The name of the property

value null or string or array Required

The value assigned to the property

"Create or update custom property values for a repository"에 대한 HTTP 응답 상태 코드

상태 코드설명
204

No Content when custom property values are successfully created or updated

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

"Create or update custom property values for a repository"에 대한 코드 샘플

요청 예제

patch/repos/{owner}/{repo}/properties/values
curl -L \ -X PATCH \ -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/properties/values \ -d '{"properties":[{"property_name":"environment","value":"production"},{"property_name":"service","value":"web"},{"property_name":"team","value":"octocat"}]}'

No Content when custom property values are successfully created or updated

Status: 204