このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となります: 2026-03-17. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise サーバーにアップグレードしてください。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせください。
リポジトリ タグの REST API エンドポイント
REST API を使って、リポジトリのタグを管理します。
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.
"Closing down - List tag protection states for a repository" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Administration" repository permissions (read)
 
"Closing down - List tag protection states for a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
"Closing down - List tag protection states for a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
200 | OK  | 
403 | Forbidden  | 
404 | Resource not found  | 
"Closing down - List tag protection states for a repository" のコード サンプル
要求の例
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.
"Closing down - Create a tag protection state for a repository" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Administration" repository permissions (write)
 
"Closing down - Create a tag protection state for a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
| 名前, Type, 説明 | 
|---|
pattern string 必須An optional glob pattern to match against when enforcing tag protection.  | 
"Closing down - Create a tag protection state for a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
201 | Created  | 
403 | Forbidden  | 
404 | Resource not found  | 
"Closing down - Create a tag protection state for a repository" のコード サンプル
要求の例
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.
"Closing down - Delete a tag protection state for a repository" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Administration" repository permissions (write)
 
"Closing down - Delete a tag protection state for a repository" のパラメーター
| 名前, Type, 説明 | 
|---|
accept string Setting to   | 
| 名前, Type, 説明 | 
|---|
owner string 必須The account owner of the repository. The name is not case sensitive.  | 
repo string 必須The name of the repository without the   | 
tag_protection_id integer 必須The unique identifier of the tag protection.  | 
"Closing down - Delete a tag protection state for a repository" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
204 | No Content  | 
403 | Forbidden  | 
404 | Resource not found  | 
"Closing down - Delete a tag protection state for a repository" のコード サンプル
要求の例
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