カスタム プロパティの REST API エンドポイント
REST API を使用して、組織によってリポジトリに割り当てられたカスタム プロパティを一覧表示します。
カスタム プロパティについて
REST API を使用して、リポジトリを所有する組織によってリポジトリに割り当てられたカスタム プロパティを表示できます。 詳しくは、「AUTOTITLE」をご覧ください。 カスタム プロパティを管理するための REST API エンドポイントの詳細については、「AUTOTITLE」を参照してください。
Get all custom property values for a repository
Gets all custom property values that are set for a repository. Users with read access to the repository can use this endpoint.
"Get all custom property values for a repository" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Metadata" repository permissions (read)
このエンドポイントは、パブリック リソースのみが要求される場合は、認証または前述メンションアクセス許可なしで使用できます。
"Get all custom property values for a repository" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
"Get all custom property values for a repository" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"Get all custom property values 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/properties/valuesResponse
Status: 200[
{
"property_name": "environment",
"value": "production"
},
{
"property_name": "service",
"value": "web"
},
{
"property_name": "team",
"value": "octocat"
}
]Create or update custom property values for a repository
Create new or update existing custom property values for a repository.
Using a value of null for a custom property will remove or 'unset' the property value from the repository.
Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint.
"Create or update custom property values for a repository" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Custom properties" repository permissions (write)
"Create or update custom property values for a repository" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
owner string 必須The account owner of the repository. The name is not case sensitive. |
repo string 必須The name of the repository without the |
| 名前, タイプ, 説明 | |||
|---|---|---|---|
properties array of objects 必須A list of custom property names and associated values to apply to the repositories. | |||
Properties of |
| 名前, タイプ, 説明 |
|---|
property_name string 必須The name of the property |
value null or string or array 必須The value assigned to the property |
"Create or update custom property values for a repository" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
204 | No Content when custom property values are successfully created or updated |
403 | Forbidden |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
"Create or update custom property values for a repository" のコード サンプル
要求の例
curl -L \
-X PATCH \
-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/properties/values \
-d '{"properties":[{"property_name":"environment","value":"production"},{"property_name":"service","value":"web"},{"property_name":"team","value":"octocat"}]}'No Content when custom property values are successfully created or updated
Status: 204