MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / get_runs

Method get_runs

github/Workflow.py:182–229  ·  view source on GitHub ↗

:calls: `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs `_

(
        self,
        actor: Opt[github.NamedUser.NamedUser | str] = NotSet,
        branch: Opt[github.Branch.Branch | str] = NotSet,
        event: Opt[str] = NotSet,
        status: Opt[str] = NotSet,
        created: Opt[str] = NotSet,
        exclude_pull_requests: Opt[bool] = NotSet,
        check_suite_id: Opt[int] = NotSet,
        head_sha: Opt[str] = NotSet,
    )

Source from the content-addressed store, hash-verified

180 return status == 204
181
182 def get_runs(
183 self,
184 actor: Opt[github.NamedUser.NamedUser | str] = NotSet,
185 branch: Opt[github.Branch.Branch | str] = NotSet,
186 event: Opt[str] = NotSet,
187 status: Opt[str] = NotSet,
188 created: Opt[str] = NotSet,
189 exclude_pull_requests: Opt[bool] = NotSet,
190 check_suite_id: Opt[int] = NotSet,
191 head_sha: Opt[str] = NotSet,
192 ) -> PaginatedList[github.WorkflowRun.WorkflowRun]:
193 """
194 :calls: `GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs <https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow>`_
195 """
196 assert actor is NotSet or isinstance(actor, github.NamedUser.NamedUser) or isinstance(actor, str), actor
197 assert branch is NotSet or isinstance(branch, github.Branch.Branch) or isinstance(branch, str), branch
198 assert event is NotSet or isinstance(event, str), event
199 assert status is NotSet or isinstance(status, str), status
200 assert created is NotSet or isinstance(created, str), created
201 assert exclude_pull_requests is NotSet or isinstance(exclude_pull_requests, bool), exclude_pull_requests
202 assert check_suite_id is NotSet or isinstance(check_suite_id, int), check_suite_id
203 assert head_sha is NotSet or isinstance(head_sha, str), head_sha
204 url_parameters: dict[str, Any] = dict()
205 if actor is not NotSet:
206 url_parameters["actor"] = actor._identity if isinstance(actor, github.NamedUser.NamedUser) else actor
207 if branch is not NotSet:
208 url_parameters["branch"] = branch.name if isinstance(branch, github.Branch.Branch) else branch
209 if event is not NotSet:
210 url_parameters["event"] = event
211 if status is not NotSet:
212 url_parameters["status"] = status
213 if created is not NotSet:
214 url_parameters["created"] = created
215 if exclude_pull_requests is not NotSet:
216 url_parameters["exclude_pull_requests"] = exclude_pull_requests
217 if check_suite_id is not NotSet:
218 url_parameters["check_suite_id"] = check_suite_id
219 if head_sha is not NotSet:
220 url_parameters["head_sha"] = head_sha
221
222 return PaginatedList(
223 github.WorkflowRun.WorkflowRun,
224 self._requester,
225 f"{self.url}/runs",
226 url_parameters,
227 headers=None,
228 list_item="workflow_runs",
229 )
230
231 def disable(self) -> bool:
232 """

Callers 5

Calls 1

PaginatedListClass · 0.90

Tested by

no test coverage detected