•  


REST API endpoints for rule suites - GitHub Docs
Skip to main content
The REST API is now versioned. For more information, see " About API versioning ."

REST API endpoints for rule suites

Use the REST API to manage rule suites for repositories.

List repository rule suites

Lists suites of rule evaluations at the repository level. For more information, see " Managing rulesets for a repository ."

Fine-grained access tokens for "List repository rule suites"

This endpoint works with the following fine-grained token types :

The fine-grained token must have the following permission set:

  • "Administration" repository permissions (write)

Parameters for "List repository rule suites"

Headers
Name, Type, Description
accept string

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

Path parameters
Name, Type, Description
owner string Required

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

repo string Required

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

Query parameters
Name, Type, Description
ref string

The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned.

time_period string

The time period to filter by.

For example, day will filter for rule suites that occurred in the past 24 hours, and week will filter for insights that occurred in the past 7 days (168 hours).

Default : day

Can be one of : hour , day , week , month

actor_name string

The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned.

rule_suite_result string

The rule results to filter on. When specified, only suites with this result will be returned.

Default : all

Can be one of : pass , fail , bypass , all

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

HTTP response status codes for "List repository rule suites"

Status code Description
200

OK

404

Resource not found

500

Internal Error

Code samples for "List repository rule suites"

Request example

get /repos /{owner} /{repo} /rulesets /rule-suites
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/rulesets/rule-suites

Response

Status: 200
[ { "id": 21, "actor_id": 12, "username": "octocat", "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", "ref": "refs/heads/i-see-everything", "repository_id": 404, "repository_name": "octo-repo", "pushed_at": "2023-07-06T08:43:03Z", "result": "bypass" }, { "id": 25, "actor_id": 11, "username": "not-octocat", "before_sha": "48994e4e01ccc943624c6231f172702b82b233cc", "after_sha": "ecfd5a1025fa271a33ca5608d089476a2df3c9a1", "ref": "refs/heads/i-am-everything", "repository_id": 404, "repository_name": "octo-repo", "pushed_at": "2023-07-07T08:43:03Z", "result": "pass", "evaluation_result": "fail" } ]

Get a repository rule suite

Gets information about a suite of rule evaluations from within a repository. For more information, see " Managing rulesets for a repository ."

Fine-grained access tokens for "Get a repository rule suite"

This endpoint works with the following fine-grained token types :

The fine-grained token must have the following permission set:

  • "Administration" repository permissions (write)

Parameters for "Get a repository rule suite"

Headers
Name, Type, Description
accept string

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

Path parameters
Name, Type, Description
owner string Required

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

repo string Required

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

rule_suite_id integer Required

The unique identifier of the rule suite result. To get this ID, you can use GET /repos/{owner}/{repo}/rulesets/rule-suites for repositories and GET /orgs/{org}/rulesets/rule-suites for organizations.

HTTP response status codes for "Get a repository rule suite"

Status code Description
200

OK

404

Resource not found

500

Internal Error

Code samples for "Get a repository rule suite"

Request example

get /repos /{owner} /{repo} /rulesets /rule-suites /{rule_ suite_ id}
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/rulesets/rule-suites/RULE_SUITE_ID

Response

Status: 200
{ "id": 21, "actor_id": 12, "username": "octocat", "before_sha": "893f768e172fb1bc9c5d6f3dd48557e45f14e01d", "after_sha": "dedd88641a362b6b4ea872da4847d6131a164d01", "ref": "refs/heads/i-see-everything", "repository_id": 404, "repository_name": "octo-repo", "pushed_at": "2023-07-06T08:43:03Z", "result": "bypass", "evaluation_result": "fail", "rule_evaluations": [ { "rule_source": { "type": "ruleset", "id": 2, "name": "Author email must be a GitHub email address" }, "enforcement": "active", "result": "pass", "rule_type": "commit_author_email_pattern" }, { "rule_source": { "type": "protected_branch" }, "enforcement": "active", "result": "fail", "rule_type": "pull_request", "details": "Changes must be made through a pull request." }, { "rule_source": { "type": "ruleset", "id": 3, "name": "Evaluate commit message pattern" }, "enforcement": "evaluate", "result": "fail", "rule_type": "commit_message_pattern" } ] }
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본