Pontos de extremidade da API REST para tags de repositório
Use a API REST para gerenciar as tags de um repositório.
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.
Tokens de acesso refinados para "Closing down - List tag protection states for a repository"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
 - Tokens de acesso à instalação do aplicativo GitHub
 - Tokens de acesso pessoal refinados
 
O token refinado deve ter os seguintes conjuntos de permissões:
- "Administration" repository permissions (read)
 
Parâmetros para "Closing down - List tag protection states for a repository"
| Nome, Tipo, Descrição | 
|---|
accept string Setting to   | 
| Nome, Tipo, Descrição | 
|---|
owner string ObrigatórioThe account owner of the repository. The name is not case sensitive.  | 
repo string ObrigatórioThe name of the repository without the   | 
Códigos de status de resposta HTTP para "Closing down - List tag protection states for a repository"
| Código de status | Descrição | 
|---|---|
200 | OK  | 
403 | Forbidden  | 
404 | Resource not found  | 
Exemplos de código para "Closing down - List tag protection states for a repository"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
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/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.
Tokens de acesso refinados para "Closing down - Create a tag protection state for a repository"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
 - Tokens de acesso à instalação do aplicativo GitHub
 - Tokens de acesso pessoal refinados
 
O token refinado deve ter os seguintes conjuntos de permissões:
- "Administration" repository permissions (write)
 
Parâmetros para "Closing down - Create a tag protection state for a repository"
| Nome, Tipo, Descrição | 
|---|
accept string Setting to   | 
| Nome, Tipo, Descrição | 
|---|
owner string ObrigatórioThe account owner of the repository. The name is not case sensitive.  | 
repo string ObrigatórioThe name of the repository without the   | 
| Nome, Tipo, Descrição | 
|---|
pattern string ObrigatórioAn optional glob pattern to match against when enforcing tag protection.  | 
Códigos de status de resposta HTTP para "Closing down - Create a tag protection state for a repository"
| Código de status | Descrição | 
|---|---|
201 | Created  | 
403 | Forbidden  | 
404 | Resource not found  | 
Exemplos de código para "Closing down - Create a tag protection state for a repository"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -X POST \
  -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/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.
Tokens de acesso refinados para "Closing down - Delete a tag protection state for a repository"
Esse ponto de extremidade funciona com os seguintes tipos de token refinados:
- Tokens de acesso de usuário do aplicativo GitHub
 - Tokens de acesso à instalação do aplicativo GitHub
 - Tokens de acesso pessoal refinados
 
O token refinado deve ter os seguintes conjuntos de permissões:
- "Administration" repository permissions (write)
 
Parâmetros para "Closing down - Delete a tag protection state for a repository"
| Nome, Tipo, Descrição | 
|---|
accept string Setting to   | 
| Nome, Tipo, Descrição | 
|---|
owner string ObrigatórioThe account owner of the repository. The name is not case sensitive.  | 
repo string ObrigatórioThe name of the repository without the   | 
tag_protection_id integer ObrigatórioThe unique identifier of the tag protection.  | 
Códigos de status de resposta HTTP para "Closing down - Delete a tag protection state for a repository"
| Código de status | Descrição | 
|---|---|
204 | No Content  | 
403 | Forbidden  | 
404 | Resource not found  | 
Exemplos de código para "Closing down - Delete a tag protection state for a repository"
Se você acessar o GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
  -X DELETE \
  -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/tags/protection/TAG_PROTECTION_IDResponse
Status: 204