Конечные точки 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
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Metadata" repository permissions (read)
 
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "Get all custom property values for a repository"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
Коды состояния http-ответа для "Get all custom property values for a repository"
| Код состояния | Описание | 
|---|---|
200 | OK  | 
403 | Forbidden  | 
404 | Resource not found  | 
Примеры кода для "Get all custom property values for a repository"
Пример запроса
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/valuesResponse
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
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
 - Маркеры доступа к установке приложений GitHub
 - Точные личные маркеры доступа
 
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Custom properties" repository permissions (write)
 
Параметры для "Create or update custom property values for a repository"
| Имя., Тип, Description | 
|---|
accept string Setting to   | 
| Имя., Тип, Description | 
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive.  | 
repo string Обязательное полеThe name of the repository without the   | 
| Имя., Тип, Description | |||
|---|---|---|---|
properties array of objects Обязательное полеA list of custom property names and associated values to apply to the repositories.  | |||
Properties of  | 
| Имя., Тип, Description | 
|---|
property_name string Обязательное полеThe name of the property  | 
value null or string or array Обязательное полеThe value assigned to the property  | 
Коды состояния http-ответа для "Create or update custom property values for a repository"
| Код состояния | Описание | 
|---|---|
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"
Пример запроса
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