Search + K

Command Palette

Search for a command to run...

Sign In

Closing down - Create a tag protection state for a repository

Deprecated
POST /repos/{owner}/{repo}/tags/protection
Copy endpoint
https://api.github.com

[!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.

Parameters

path Path Parameters

Name Type
owner required

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

string
repo required

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

string

Request Body

application/json required
{ pattern: string; }

Responses

201 application/json

Response

interface TagProtection {
id?: number;
created_at?: string;
updated_at?: string;
enabled?: boolean;
pattern: string;
}

Client Errors

403 application/json

Forbidden

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
404 application/json

Resource not found

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}