Esta versión de GitHub Enterprise Server se discontinuó el 2024-07-09. No se realizarán lanzamientos de patch, ni siquiera para problemas de seguridad críticos. Para obtener rendimiento mejorado, seguridad mejorada y nuevas características, actualice a la versión más reciente de GitHub Enterprise Server. Para obtener ayuda con la actualización, póngase en contacto con el soporte técnico de GitHub Enterprise.
Puntos de conexión de la API de REST para etiquetas de repositorio
Usa la API de REST para administrar etiquetas para un repositorio.
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.
Parámetros para "Deprecated - List tag protection states for a repository"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
owner string RequeridoThe account owner of the repository. The name is not case sensitive. |
repo string RequeridoThe name of the repository without the |
Códigos de estado de respuesta HTTP para "Deprecated - List tag protection states for a repository"
status code | Descripción |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Ejemplos de código para "Deprecated - List tag protection states for a repository"
Ejemplo de solicitud
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/protection
Response
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.
Parámetros para "Deprecated - Create a tag protection state for a repository"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
owner string RequeridoThe account owner of the repository. The name is not case sensitive. |
repo string RequeridoThe name of the repository without the |
Nombre, Tipo, Descripción |
---|
pattern string RequeridoAn optional glob pattern to match against when enforcing tag protection. |
Códigos de estado de respuesta HTTP para "Deprecated - Create a tag protection state for a repository"
status code | Descripción |
---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
Ejemplos de código para "Deprecated - Create a tag protection state for a repository"
Ejemplo de solicitud
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.
Parámetros para "Deprecated - Delete a tag protection state for a repository"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
owner string RequeridoThe account owner of the repository. The name is not case sensitive. |
repo string RequeridoThe name of the repository without the |
tag_protection_id integer RequeridoThe unique identifier of the tag protection. |
Códigos de estado de respuesta HTTP para "Deprecated - Delete a tag protection state for a repository"
status code | Descripción |
---|---|
204 | No Content |
403 | Forbidden |
404 | Resource not found |
Ejemplos de código para "Deprecated - Delete a tag protection state for a repository"
Ejemplo de solicitud
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_ID
Response
Status: 204