Cette version de GitHub Enterprise Server n'est plus disponible depuis le 2024-07-09. 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.
Points de terminaison d’API REST pour les balises du référentiel
Utilisez l’API REST pour gérer les étiquettes d’un référentiel.
Deprecated - List tag protection states for a repository
Note: This operation is deprecated and will be removed after August 30th 2024 Use the "Repository Rulesets" endpoint instead.
This returns the tag protection states of a repository.
This information is only available to repository administrators.
Paramètres pour « Deprecated - List tag protection states for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Codes d’état de la réponse HTTP pour « Deprecated - List tag protection states for a repository »
| Code d’état | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Deprecated - List tag protection states for a repository »
Exemple de requête
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/tags/protectionResponse
Status: 200[
{
"id": 2,
"pattern": "v1.*"
}
]Deprecated - Create a tag protection state for a repository
Note: This operation is deprecated and will be removed after August 30th 2024 Use the "Repository Rulesets" endpoint instead.
This creates a tag protection state for a repository. This endpoint is only available to repository administrators.
Paramètres pour « Deprecated - Create a tag protection state for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
| Nom, Type, Description |
|---|
pattern string ObligatoireAn optional glob pattern to match against when enforcing tag protection. |
Codes d’état de la réponse HTTP pour « Deprecated - Create a tag protection state for a repository »
| Code d’état | Description |
|---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Deprecated - Create a tag protection state for a repository »
Exemple de requête
curl -L \
-X POST \
-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/tags/protection \
-d '{"pattern":"v1.*"}'Response
Status: 201{
"enabled": true
}Deprecated - Delete a tag protection state for a repository
Note: This operation is deprecated and will be removed after August 30th 2024 Use the "Repository Rulesets" endpoint instead.
This deletes a tag protection state for a repository. This endpoint is only available to repository administrators.
Paramètres pour « Deprecated - Delete a tag protection state for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
tag_protection_id integer ObligatoireThe unique identifier of the tag protection. |
Codes d’état de la réponse HTTP pour « Deprecated - Delete a tag protection state for a repository »
| Code d’état | Description |
|---|---|
204 | No Content |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour « Deprecated - Delete a tag protection state for a repository »
Exemple de requête
curl -L \
-X DELETE \
-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/tags/protection/TAG_PROTECTION_IDResponse
Status: 204