Skip to main content

Cette version de GitHub Enterprise Server ne sera plus disponible le 2026-06-02. Aucune publication de correctifs n’est effectuée, même pour les problèmes de sécurité critiques. Pour de meilleures performances, une sécurité améliorée et de nouvelles fonctionnalités, effectuez une mise à niveau vers la dernière version de GitHub Enterprise. Pour obtenir de l’aide sur la mise à niveau, contactez le support GitHub Enterprise.

L’API REST est maintenant versionnée. Pour plus d’informations, consultez « À propos des versions de l’API ».

Points de terminaison d’API REST pour les propriétés personnalisées

Utilisez l’API REST pour répertorier les propriétés personnalisées attribuées à un référentiel par l’organisation.

À propos des propriétés personnalisées

Vous pouvez utiliser l’API REST pour afficher les propriétés personnalisées attribuées à un référentiel par l’organisation propriétaire du référentiel. Pour plus d’informations, consultez « Gestion des propriétés personnalisées pour les référentiels de votre organisation ». Pour plus d’informations sur les points de terminaison d’API REST pour gérer les propriétés personnalisées, consultez Points de terminaison d’API REST pour les propriétés personnalisées.

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.

fine_grained_access

works_with_fine_grained_tokens:

permission_set:

  • "Metadata" repository permissions (read)

allows_public_read_access

Paramètres pour «Get all custom property values for a repository »

En-têtes
Nom, Type, Description
accept string

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

Paramètres de chemin d’accès
Nom, Type, Description
owner string Requis

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

repo string Requis

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

http_status_code

status_codeDescription
200

OK

403

Forbidden

404

Resource not found

code_samples

request_example

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" \ http(s)://HOSTNAME/api/v3/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.

fine_grained_access

works_with_fine_grained_tokens:

permission_set:

  • "Custom properties" repository permissions (write)

Paramètres pour «Create or update custom property values for a repository »

En-têtes
Nom, Type, Description
accept string

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

Paramètres de chemin d’accès
Nom, Type, Description
owner string Requis

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

repo string Requis

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

Paramètres du corps
Nom, Type, Description
properties array of objects Requis

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

Nom, Type, Description
property_name string Requis

The name of the property

value null or string or array Requis

The value assigned to the property

http_status_code

status_codeDescription
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.

code_samples

request_example

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" \ http(s)://HOSTNAME/api/v3/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