Cette version de GitHub Enterprise Server ne sera plus disponible le 2026-08-25. Les versions abandonnées ne sont pas prises en charge. 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 dans GitHub Enterprise Server, consultez Overview du processus de mise à niveau. Pour obtenir de l’aide sur la mise à niveau, GitHub Support Entreprise.
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.
Closing down - List tag protection states for a repository
Warning
Closing down notice: This operation is closing down and will be removed after August 30, 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 «Closing down - List tag protection states for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string RequisThe account owner of the repository. The name is not case sensitive. |
repo string RequisThe name of the repository without the |
Codes d’état de réponse HTTP pour «Closing down - List tag protection states for a repository »
| Code de statut | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour «Closing down - 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.*"
}
]Closing down - Create a tag protection state for a repository
Warning
Closing down notice: This operation is closing down and will be removed after August 30, 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 «Closing down - Create a tag protection state for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string RequisThe account owner of the repository. The name is not case sensitive. |
repo string RequisThe name of the repository without the |
| Nom, Type, Description |
|---|
pattern string RequisAn optional glob pattern to match against when enforcing tag protection. |
Codes d’état de réponse HTTP pour «Closing down - Create a tag protection state for a repository »
| Code de statut | Description |
|---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour «Closing down - 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
}Closing down - Delete a tag protection state for a repository
Warning
Closing down notice: This operation is closing down and will be removed after August 30, 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 «Closing down - Delete a tag protection state for a repository »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
owner string RequisThe account owner of the repository. The name is not case sensitive. |
repo string RequisThe name of the repository without the |
tag_protection_id integer RequisThe unique identifier of the tag protection. |
Codes d’état de réponse HTTP pour «Closing down - Delete a tag protection state for a repository »
| Code de statut | Description |
|---|---|
204 | No Content |
403 | Forbidden |
404 | Resource not found |
Exemples de code pour «Closing down - 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