Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

ルールの REST API エンドポイント

REST API を使って、Enterprise のルールセットを管理します。 ルールセットを使って、ユーザーがリポジトリやコードを操作する方法を制御できます。

Get enterprise ruleset history

Get the history of an enterprise ruleset.

"Get enterprise ruleset history" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Get enterprise ruleset history" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

Setting to application/vnd.github+json is recommended.

パス パラメーター
名前, タイプ, 説明
enterprise string 必須

The slug version of the enterprise name.

ruleset_id integer 必須

The ID of the ruleset.

クエリ パラメーター
名前, タイプ, 説明
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Default: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Default: 1

"Get enterprise ruleset history" の HTTP 応答状態コード

状態コード説明
200

OK

404

Resource not found

500

Internal Error

"Get enterprise ruleset history" のコード サンプル

要求の例

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history
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/enterprises/ENTERPRISE/rulesets/RULESET_ID/history

Response

Status: 200
[ { "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-010-23T16:29:47Z" }, { "version_id": 2, "actor": { "id": 2, "type": "User" }, "updated_at": "2024-09-23T16:29:47Z" }, { "version_id": 1, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-08-23T16:29:47Z" } ]

Get enterprise ruleset version

Get a version of an enterprise ruleset.

"Get enterprise ruleset version" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Get enterprise ruleset version" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

Setting to application/vnd.github+json is recommended.

パス パラメーター
名前, タイプ, 説明
enterprise string 必須

The slug version of the enterprise name.

ruleset_id integer 必須

The ID of the ruleset.

version_id integer 必須

The ID of the version

"Get enterprise ruleset version" の HTTP 応答状態コード

状態コード説明
200

OK

404

Resource not found

500

Internal Error

"Get enterprise ruleset version" のコード サンプル

要求の例

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history/{version_id}
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/enterprises/ENTERPRISE/rulesets/RULESET_ID/history/VERSION_ID

Response

Status: 200
[ { "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-010-23T16:29:47Z", "state": { "id": 21, "name": "super cool ruleset", "target": "repository", "source_type": "Enterprise", "source": "my-enterprise", "enforcement": "active", "conditions": { "organization_name": { "include": [ "important_organization" ] }, "repository_name": { "include": [ "~ALL" ] } }, "rules": [ { "type": "repository_delete" } ] } } ]