From a4854519c6e69092c03d8f7f6eef6bf92d80806f Mon Sep 17 00:00:00 2001 From: Trim21 Date: Tue, 23 May 2023 22:07:21 +0800 Subject: [PATCH] Add query `check_suite_id` integer to `Workflow.get_runs` (#2466) --- github/GithubObject.pyi | 2 ++ github/Workflow.py | 7 +++++++ github/Workflow.pyi | 1 + 3 files changed, 10 insertions(+) diff --git a/github/GithubObject.pyi b/github/GithubObject.pyi index 38f2c7e1..28baa0bc 100644 --- a/github/GithubObject.pyi +++ b/github/GithubObject.pyi @@ -122,3 +122,5 @@ class _NotSetType: class _ValuedAttribute: def __init__(self, value: Any) -> None: ... + +NotSet: _NotSetType diff --git a/github/Workflow.py b/github/Workflow.py index 8029df5d..382d6cab 100644 --- a/github/Workflow.py +++ b/github/Workflow.py @@ -137,6 +137,7 @@ class Workflow(github.GithubObject.CompletableGithubObject): branch=github.GithubObject.NotSet, event=github.GithubObject.NotSet, status=github.GithubObject.NotSet, + check_suite_id=github.GithubObject.NotSet, ): """ :calls: `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs `_ @@ -158,6 +159,9 @@ class Workflow(github.GithubObject.CompletableGithubObject): ), branch assert event is github.GithubObject.NotSet or isinstance(event, str), event assert status is github.GithubObject.NotSet or isinstance(status, str), status + assert check_suite_id is github.GithubObject.NotSet or isinstance( + check_suite_id, int + ), check_suite_id url_parameters = dict() if actor is not github.GithubObject.NotSet: url_parameters["actor"] = ( @@ -173,6 +177,9 @@ class Workflow(github.GithubObject.CompletableGithubObject): url_parameters["event"] = event if status is not github.GithubObject.NotSet: url_parameters["status"] = status + if check_suite_id is not github.GithubObject.NotSet: + url_parameters["check_suite_id"] = check_suite_id + return github.PaginatedList.PaginatedList( github.WorkflowRun.WorkflowRun, self._requester, diff --git a/github/Workflow.pyi b/github/Workflow.pyi index db706c01..489942f3 100644 --- a/github/Workflow.pyi +++ b/github/Workflow.pyi @@ -24,6 +24,7 @@ class Workflow(CompletableGithubObject): branch: Union[str, Branch, _NotSetType] = ..., event: Union[str, _NotSetType] = ..., status: Union[str, _NotSetType] = ..., + check_suite_id: Union[int, _NotSetType] = ..., ) -> PaginatedList[WorkflowRun]: ... @property def id(self) -> int: ...