From 804c3107c822d4c643e2109a4ade4f5f71e06936 Mon Sep 17 00:00:00 2001 From: Jeppe Fihl-Pearson Date: Tue, 20 Jun 2023 07:37:56 +0100 Subject: [PATCH] Add support for workflow jobs and steps (#1951) Co-authored-by: Enrico Minack --- github/WorkflowJob.py | 201 ++++++++++++++++++ github/WorkflowJob.pyi | 39 ++++ github/WorkflowRun.py | 23 ++ github/WorkflowRun.pyi | 9 +- github/WorkflowStep.py | 104 +++++++++ github/WorkflowStep.pyi | 21 ++ tests/ReplayData/WorkflowJob.setUp.txt | 33 +++ .../ReplayData/WorkflowJob.testAttributes.txt | 11 + tests/ReplayData/WorkflowRun.test_jobs.txt | 11 + tests/WorkflowJob.py | 80 +++++++ tests/WorkflowRun.py | 7 + 11 files changed, 537 insertions(+), 2 deletions(-) create mode 100644 github/WorkflowJob.py create mode 100644 github/WorkflowJob.pyi create mode 100644 github/WorkflowStep.py create mode 100644 github/WorkflowStep.pyi create mode 100644 tests/ReplayData/WorkflowJob.setUp.txt create mode 100644 tests/ReplayData/WorkflowJob.testAttributes.txt create mode 100644 tests/ReplayData/WorkflowRun.test_jobs.txt create mode 100644 tests/WorkflowJob.py diff --git a/github/WorkflowJob.py b/github/WorkflowJob.py new file mode 100644 index 0000000000..5211900dee --- /dev/null +++ b/github/WorkflowJob.py @@ -0,0 +1,201 @@ +############################ Copyrights and license ############################ +# # +# Copyright 2021 Jeppe Fihl-Pearson # +# # +# This file is part of PyGithub. # +# http://pygithub.readthedocs.io/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import github.GithubObject +import github.WorkflowStep + + +class WorkflowJob(github.GithubObject.CompletableGithubObject): + """ + This class represents Workflow Jobs. The reference can be found here https://docs.github.com/en/rest/reference/actions#workflow-jobs + """ + + def __repr__(self): + return self.get__repr__({"id": self._id.value, "url": self._url.value}) + + @property + def check_run_url(self): + """ + :type: string + """ + self._completeIfNotSet(self._check_run_url) + return self._check_run_url.value + + @property + def completed_at(self): + """ + :type: datetime.datetime + """ + self._completeIfNotSet(self._completed_at) + return self._completed_at.value + + @property + def conclusion(self): + """ + :type: string + """ + self._completeIfNotSet(self._conclusion) + return self._conclusion.value + + @property + def head_sha(self): + """ + :type: string + """ + self._completeIfNotSet(self._head_sha) + return self._head_sha.value + + @property + def html_url(self): + """ + :type: string + """ + self._completeIfNotSet(self._html_url) + return self._html_url.value + + @property + def id(self): + """ + :type: int + """ + self._completeIfNotSet(self._id) + return self._id.value + + @property + def name(self): + """ + :type: string + """ + self._completeIfNotSet(self._name) + return self._name.value + + @property + def node_id(self): + """ + :type: string + """ + self._completeIfNotSet(self._node_id) + return self._node_id.value + + @property + def run_id(self): + """ + :type: integer + """ + self._completeIfNotSet(self._run_id) + return self._run_id.value + + @property + def run_url(self): + """ + :type: string + """ + self._completeIfNotSet(self._run_url) + return self._run_url.value + + @property + def started_at(self): + """ + :type: datetime.datetime + """ + self._completeIfNotSet(self._started_at) + return self._started_at.value + + @property + def status(self): + """ + :type: string + """ + self._completeIfNotSet(self._status) + return self._status.value + + @property + def steps(self): + """ + :type: list of github.WorkflowStep.WorkflowStep + """ + self._completeIfNotSet(self._steps) + return self._steps.value + + @property + def url(self): + """ + :type: string + """ + self._completeIfNotSet(self._url) + return self._url.value + + def logs_url(self): + """ + :type: string + """ + print(f"{self.url}/logs") + headers, _ = self._requester.requestBlobAndCheck("GET", f"{self.url}/logs") + return headers["location"] + + def _initAttributes(self): + self._check_run_url = github.GithubObject.NotSet + self._completed_at = github.GithubObject.NotSet + self._conclusion = github.GithubObject.NotSet + self._head_sha = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._node_id = github.GithubObject.NotSet + self._run_id = github.GithubObject.NotSet + self._run_url = github.GithubObject.NotSet + self._started_at = github.GithubObject.NotSet + self._status = github.GithubObject.NotSet + self._steps = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + + def _useAttributes(self, attributes): + if "check_run_url" in attributes: # pragma no branch + self._check_run_url = self._makeStringAttribute(attributes["check_run_url"]) + if "completed_at" in attributes: # pragma no branch + self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"]) + if "conclusion" in attributes: # pragma no branch + self._conclusion = self._makeStringAttribute(attributes["conclusion"]) + if "head_sha" in attributes: # pragma no branch + self._head_sha = self._makeStringAttribute(attributes["head_sha"]) + if "html_url" in attributes: # pragma no branch + self._html_url = self._makeStringAttribute(attributes["html_url"]) + if "id" in attributes: # pragma no branch + self._id = self._makeIntAttribute(attributes["id"]) + if "name" in attributes: # pragma no branch + self._name = self._makeStringAttribute(attributes["name"]) + if "node_id" in attributes: # pragma no branch + self._node_id = self._makeStringAttribute(attributes["node_id"]) + if "run_id" in attributes: # pragma no branch + self._run_id = self._makeIntAttribute(attributes["run_id"]) + if "run_url" in attributes: # pragma no branch + self._run_url = self._makeStringAttribute(attributes["run_url"]) + if "started_at" in attributes: # pragma no branch + self._started_at = self._makeDatetimeAttribute(attributes["started_at"]) + if "status" in attributes: # pragma no branch + self._status = self._makeStringAttribute(attributes["status"]) + if "steps" in attributes: # pragma no branch + self._steps = self._makeListOfClassesAttribute( + github.WorkflowStep.WorkflowStep, attributes["steps"] + ) + if "url" in attributes: # pragma no branch + self._url = self._makeStringAttribute(attributes["url"]) diff --git a/github/WorkflowJob.pyi b/github/WorkflowJob.pyi new file mode 100644 index 0000000000..44bcb2f681 --- /dev/null +++ b/github/WorkflowJob.pyi @@ -0,0 +1,39 @@ +from datetime import datetime +from typing import Any, Dict, List + +from github.GithubObject import CompletableGithubObject +from github.WorkflowStep import WorkflowStep + +class WorkflowJob(CompletableGithubObject): + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def check_run_url(self) -> str: ... + @property + def completed_at(self) -> datetime: ... + @property + def conclusion(self) -> str: ... + @property + def head_sha(self) -> str: ... + @property + def html_url(self) -> str: ... + @property + def id(self) -> int: ... + @property + def name(self) -> str: ... + @property + def node_id(self) -> str: ... + @property + def run_id(self) -> int: ... + @property + def run_url(self) -> str: ... + @property + def started_at(self) -> datetime: ... + @property + def status(self) -> str: ... + @property + def steps(self) -> List[WorkflowStep]: ... + @property + def url(self) -> str: ... + def logs_url(self) -> str: ... diff --git a/github/WorkflowRun.py b/github/WorkflowRun.py index da815f9e14..1fbed3f0a8 100644 --- a/github/WorkflowRun.py +++ b/github/WorkflowRun.py @@ -26,6 +26,7 @@ import github.Artifact import github.GithubObject import github.PullRequest +import github.WorkflowJob class WorkflowRun(github.GithubObject.CompletableGithubObject): @@ -302,6 +303,28 @@ def delete(self): status, _, _ = self._requester.requestJson("DELETE", self.url) return status == 204 + def jobs(self, _filter=github.GithubObject.NotSet): + """ + :calls "`GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs `_ + :param _filter: string `latest`, or `all` + :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.WorkflowJob.WorkflowJob` + """ + assert _filter is github.GithubObject.NotSet or isinstance( + _filter, str + ), _filter + + url_parameters = dict() + if _filter is not github.GithubObject.NotSet: + url_parameters["filter"] = _filter + + return github.PaginatedList.PaginatedList( + github.WorkflowJob.WorkflowJob, + self._requester, + self.jobs_url, + url_parameters, + list_item="jobs", + ) + def _initAttributes(self): self._id = github.GithubObject.NotSet self._name = github.GithubObject.NotSet diff --git a/github/WorkflowRun.pyi b/github/WorkflowRun.pyi index 03f698ac77..6c21016060 100644 --- a/github/WorkflowRun.pyi +++ b/github/WorkflowRun.pyi @@ -1,10 +1,12 @@ from datetime import datetime -from typing import Any, Dict, NamedTuple, List +from typing import Any, Dict, NamedTuple, List, Union from github.GitCommit import GitCommit -from github.GithubObject import CompletableGithubObject +from github.GithubObject import CompletableGithubObject, _NotSetType +from github.PaginatedList import PaginatedList from github.PullRequest import PullRequest from github.Repository import Repository +from github.WorkflowJob import WorkflowJob class TimingData(NamedTuple): billable: Dict[str, Dict[str, int]] @@ -71,5 +73,8 @@ class WorkflowRun(CompletableGithubObject): @property def head_repository(self) -> Repository: ... def cancel(self) -> bool: ... + def jobs( + self, _filter: Union[str, _NotSetType] = ... + ) -> PaginatedList[WorkflowJob]: ... def rerun(self) -> bool: ... def timing(self) -> TimingData: ... diff --git a/github/WorkflowStep.py b/github/WorkflowStep.py new file mode 100644 index 0000000000..8ae2e9886d --- /dev/null +++ b/github/WorkflowStep.py @@ -0,0 +1,104 @@ +############################ Copyrights and license ############################ +# # +# Copyright 2021 Jeppe Fihl-Pearson # +# # +# This file is part of PyGithub. # +# http://pygithub.readthedocs.io/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import github.GithubObject + + +class WorkflowStep(github.GithubObject.CompletableGithubObject): + """ + This class represents steps in a Workflow Job. The reference can be found here https://docs.github.com/en/rest/reference/actions#workflow-jobs + """ + + def __repr__(self): + return self.get__repr__( + {"number": self._number.value, "name": self._name.value} + ) + + @property + def completed_at(self): + """ + :type: datetime.datetime + """ + self._completeIfNotSet(self._completed_at) + return self._completed_at.value + + @property + def conclusion(self): + """ + :type: string + """ + self._completeIfNotSet(self._conclusion) + return self._conclusion.value + + @property + def name(self): + """ + :type: string + """ + self._completeIfNotSet(self._name) + return self._name.value + + @property + def number(self): + """ + :type: integer + """ + self._completeIfNotSet(self._number) + return self._number.value + + @property + def started_at(self): + """ + :type: datetime.datetime + """ + self._completeIfNotSet(self._started_at) + return self._started_at.value + + @property + def status(self): + """ + :type: string + """ + self._completeIfNotSet(self._status) + return self._status.value + + def _initAttributes(self): + self._completed_at = github.GithubObject.NotSet + self._conclusion = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._number = github.GithubObject.NotSet + self._started_at = github.GithubObject.NotSet + self._status = github.GithubObject.NotSet + + def _useAttributes(self, attributes): + if "completed_at" in attributes: # pragma no branch + self._completed_at = self._makeDatetimeAttribute(attributes["completed_at"]) + if "conclusion" in attributes: # pragma no branch + self._conclusion = self._makeStringAttribute(attributes["conclusion"]) + if "name" in attributes: # pragma no branch + self._name = self._makeStringAttribute(attributes["name"]) + if "number" in attributes: # pragma no branch + self._number = self._makeIntAttribute(attributes["number"]) + if "started_at" in attributes: # pragma no branch + self._started_at = self._makeDatetimeAttribute(attributes["started_at"]) + if "status" in attributes: # pragma no branch + self._status = self._makeStringAttribute(attributes["status"]) diff --git a/github/WorkflowStep.pyi b/github/WorkflowStep.pyi new file mode 100644 index 0000000000..1d90ff7a68 --- /dev/null +++ b/github/WorkflowStep.pyi @@ -0,0 +1,21 @@ +from datetime import datetime +from typing import Any, Dict + +from github.GithubObject import CompletableGithubObject + +class WorkflowStep(CompletableGithubObject): + def __repr__(self) -> str: ... + def _initAttributes(self) -> None: ... + def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... + @property + def completed_at(self) -> datetime: ... + @property + def conclusion(self) -> str: ... + @property + def name(self) -> str: ... + @property + def number(self) -> int: ... + @property + def started_at(self) -> datetime: ... + @property + def status(self) -> str: ... diff --git a/tests/ReplayData/WorkflowJob.setUp.txt b/tests/ReplayData/WorkflowJob.setUp.txt new file mode 100644 index 0000000000..b9ca804749 --- /dev/null +++ b/tests/ReplayData/WorkflowJob.setUp.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Wed, 15 Mar 2023 17:03:30 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"5a8d0c04b22faf083b4eea90698de217a6419438e9d143138f566cf60cad0ad8"'), ('Last-Modified', 'Mon, 10 Jan 2022 09:52:55 GMT'), ('github-authentication-token-expiration', '2023-04-14 15:56:10 +0200'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4995'), ('X-RateLimit-Reset', '1678903315'), ('X-RateLimit-Used', '5'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '85C4:3628:24DDD6D:2579498:6411FA61')] +{"id":446365735,"node_id":"R_kgDOGpsAJw","name":"PyGithub","full_name":"PyGithub/PyGithub","private":false,"owner":{"login":"PyGithub","id":44700269,"node_id":"MDQ6VXNlcjQ0NzAwMjY5","avatar_url":"https://avatars.githubusercontent.com/u/44700269?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"User","site_admin":false},"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments","created_at":"2022-01-10T09:52:53Z","updated_at":"2022-01-10T09:52:55Z","pushed_at":"2023-03-14T22:41:43Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"https://PyGithub.readthedocs.io/","size":13898,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":1,"open_issues":2,"watchers":0,"default_branch":"master","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"parent":{"id":3544490,"node_id":"MDEwOlJlcG9zaXRvcnkzNTQ0NDkw","name":"PyGithub","full_name":"PyGithub/PyGithub","private":false,"owner":{"login":"PyGithub","id":11288996,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4OTk2","avatar_url":"https://avatars.githubusercontent.com/u/11288996?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments","created_at":"2012-02-25T12:53:47Z","updated_at":"2023-03-15T17:02:12Z","pushed_at":"2023-03-14T22:46:37Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"https://PyGithub.readthedocs.io/","size":13760,"stargazers_count":5854,"watchers_count":5854,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":true,"forks_count":1598,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":219,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["github","github-api","PyGithub","python"],"visibility":"public","forks":1598,"open_issues":219,"watchers":5854,"default_branch":"master"},"source":{"id":3544490,"node_id":"MDEwOlJlcG9zaXRvcnkzNTQ0NDkw","name":"PyGithub","full_name":"PyGithub/PyGithub","private":false,"owner":{"login":"PyGithub","id":11288996,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMjg4OTk2","avatar_url":"https://avatars.githubusercontent.com/u/11288996?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments","created_at":"2012-02-25T12:53:47Z","updated_at":"2023-03-15T17:02:12Z","pushed_at":"2023-03-14T22:46:37Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"https://PyGithub.readthedocs.io/","size":13760,"stargazers_count":5854,"watchers_count":5854,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":true,"forks_count":1598,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":219,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["github","github-api","PyGithub","python"],"visibility":"public","forks":1598,"open_issues":219,"watchers":5854,"default_branch":"master"},"network_count":1598,"subscribers_count":0} + +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/runs/4205440316 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Wed, 15 Mar 2023 17:03:31 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"acc4b146279eaa2d142f50ba219289525501ba8cf3599ba32b882ded249c89f6"'), ('github-authentication-token-expiration', '2023-04-14 15:56:10 +0200'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4994'), ('X-RateLimit-Reset', '1678903315'), ('X-RateLimit-Used', '6'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '85CA:1D8D:2FED38E:30CA735:6411FA62')] +{"id":4205440316,"name":"CI","node_id":"WFR_kwLOGpsAJ876qe08","head_branch":"tz-aware-2","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","path":".github/workflows/ci.yml","display_title":"Fix lint","run_number":5,"event":"push","status":"completed","conclusion":"success","workflow_id":48708658,"check_suite_id":11050312883,"check_suite_node_id":"CS_kwDOGpsAJ88AAAACkqZksw","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316","pull_requests":[],"created_at":"2023-02-17T16:03:37Z","updated_at":"2023-02-17T16:06:11Z","actor":{"login":"PyGithub","id":44700269,"node_id":"MDQ6VXNlcjQ0NzAwMjY5","avatar_url":"https://avatars.githubusercontent.com/u/44700269?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"User","site_admin":false},"run_attempt":1,"referenced_workflows":[],"run_started_at":"2023-02-17T16:03:37Z","triggering_actor":{"login":"PyGithub","id":44700269,"node_id":"MDQ6VXNlcjQ0NzAwMjY5","avatar_url":"https://avatars.githubusercontent.com/u/44700269?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"User","site_admin":false},"jobs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316/jobs","logs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316/logs","check_suite_url":"https://api.github.com/repos/PyGithub/PyGithub/check-suites/11050312883","artifacts_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316/artifacts","cancel_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316/cancel","rerun_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316/rerun","previous_attempt_url":null,"workflow_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/workflows/48708658","head_commit":{"id":"06ec040b2eeef6c0316dd5abcda0608525a3f205","tree_id":"452f1c8de54c06ef19e0a76c5f9ecf427fd6ecfe","message":"Fix lint","timestamp":"2023-02-17T16:03:27Z","author":{"name":"Enrico Minack","email":"github@enrico.minack.dev"},"committer":{"name":"Enrico Minack","email":"github@enrico.minack.dev"}},"repository":{"id":446365735,"node_id":"R_kgDOGpsAJw","name":"PyGithub","full_name":"PyGithub/PyGithub","private":false,"owner":{"login":"PyGithub","id":44700269,"node_id":"MDQ6VXNlcjQ0NzAwMjY5","avatar_url":"https://avatars.githubusercontent.com/u/44700269?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"User","site_admin":false},"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments"},"head_repository":{"id":446365735,"node_id":"R_kgDOGpsAJw","name":"PyGithub","full_name":"PyGithub/PyGithub","private":false,"owner":{"login":"PyGithub","id":44700269,"node_id":"MDQ6VXNlcjQ0NzAwMjY5","avatar_url":"https://avatars.githubusercontent.com/u/44700269?v=4","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"User","site_admin":false},"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments"}} + +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/runs/4205440316/jobs +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Wed, 15 Mar 2023 17:03:31 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"d6c4dda2ce21cc2b6af0b9e26d54105f2c393c9c7be001cc75ae4509ca805dc3"'), ('github-authentication-token-expiration', '2023-04-14 15:56:10 +0200'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4993'), ('X-RateLimit-Reset', '1678903315'), ('X-RateLimit-Used', '7'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '85DA:6A07:16C0EF63:171E6998:6411FA63')] +{"total_count":5,"jobs":[{"id":11421878319,"run_id":4205440316,"workflow_name":"CI","head_branch":"tz-aware-2","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","run_attempt":1,"node_id":"CR_kwDOGpsAJ88AAAACqMwILw","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421878319","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536068","status":"completed","conclusion":"success","created_at":"2023-02-17T16:03:38Z","started_at":"2023-02-17T16:03:46Z","completed_at":"2023-02-17T16:04:52Z","name":"test (Python 3.7)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-02-17T17:03:46.000+01:00","completed_at":"2023-02-17T17:03:49.000+01:00"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-02-17T17:03:50.000+01:00","completed_at":"2023-02-17T17:03:51.000+01:00"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-02-17T17:03:51.000+01:00","completed_at":"2023-02-17T17:03:51.000+01:00"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-02-17T17:03:51.000+01:00","completed_at":"2023-02-17T17:03:57.000+01:00"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-02-17T17:03:57.000+01:00","completed_at":"2023-02-17T17:04:48.000+01:00"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-02-17T17:04:49.000+01:00","completed_at":"2023-02-17T17:04:50.000+01:00"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-02-17T17:04:52.000+01:00","completed_at":"2023-02-17T17:04:52.000+01:00"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-02-17T17:04:52.000+01:00","completed_at":"2023-02-17T17:04:52.000+01:00"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-02-17T17:04:50.000+01:00","completed_at":"2023-02-17T17:04:50.000+01:00"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421878319","labels":["ubuntu-latest"],"runner_id":2,"runner_name":"GitHub Actions 2","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":11421878551,"run_id":4205440316,"workflow_name":"CI","head_branch":"tz-aware-2","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","run_attempt":1,"node_id":"CR_kwDOGpsAJ88AAAACqMwJFw","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421878551","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536217","status":"completed","conclusion":"success","created_at":"2023-02-17T16:03:38Z","started_at":"2023-02-17T16:03:47Z","completed_at":"2023-02-17T16:06:09Z","name":"test (Python 3.8)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-02-17T17:03:46.000+01:00","completed_at":"2023-02-17T17:03:49.000+01:00"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-02-17T17:03:49.000+01:00","completed_at":"2023-02-17T17:03:51.000+01:00"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-02-17T17:03:51.000+01:00","completed_at":"2023-02-17T17:03:51.000+01:00"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-02-17T17:03:52.000+01:00","completed_at":"2023-02-17T17:03:56.000+01:00"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-02-17T17:03:57.000+01:00","completed_at":"2023-02-17T17:06:05.000+01:00"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-02-17T17:06:06.000+01:00","completed_at":"2023-02-17T17:06:07.000+01:00"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-02-17T17:06:07.000+01:00","completed_at":"2023-02-17T17:06:07.000+01:00"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-02-17T17:06:07.000+01:00","completed_at":"2023-02-17T17:06:07.000+01:00"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-02-17T17:06:07.000+01:00","completed_at":"2023-02-17T17:06:07.000+01:00"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421878551","labels":["ubuntu-latest"],"runner_id":4,"runner_name":"GitHub Actions 4","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":11421878769,"run_id":4205440316,"workflow_name":"CI","head_branch":"tz-aware-2","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","run_attempt":1,"node_id":"CR_kwDOGpsAJ88AAAACqMwJ8Q","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421878769","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536388","status":"completed","conclusion":"success","created_at":"2023-02-17T16:03:39Z","started_at":"2023-02-17T16:03:47Z","completed_at":"2023-02-17T16:04:48Z","name":"test (Python 3.9)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-02-17T17:03:47.000+01:00","completed_at":"2023-02-17T17:03:48.000+01:00"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-02-17T17:03:48.000+01:00","completed_at":"2023-02-17T17:03:50.000+01:00"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-02-17T17:03:50.000+01:00","completed_at":"2023-02-17T17:03:50.000+01:00"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-02-17T17:03:50.000+01:00","completed_at":"2023-02-17T17:03:54.000+01:00"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-02-17T17:03:55.000+01:00","completed_at":"2023-02-17T17:04:45.000+01:00"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-02-17T17:04:46.000+01:00","completed_at":"2023-02-17T17:04:47.000+01:00"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-02-17T17:04:48.000+01:00","completed_at":"2023-02-17T17:04:48.000+01:00"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-02-17T17:04:48.000+01:00","completed_at":"2023-02-17T17:04:48.000+01:00"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-02-17T17:04:47.000+01:00","completed_at":"2023-02-17T17:04:47.000+01:00"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421878769","labels":["ubuntu-latest"],"runner_id":5,"runner_name":"GitHub Actions 5","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":11421878999,"run_id":4205440316,"workflow_name":"CI","head_branch":"tz-aware-2","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","run_attempt":1,"node_id":"CR_kwDOGpsAJ88AAAACqMwK1w","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421878999","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536561","status":"completed","conclusion":"success","created_at":"2023-02-17T16:03:39Z","started_at":"2023-02-17T16:03:45Z","completed_at":"2023-02-17T16:04:50Z","name":"test (Python 3.10)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-02-17T17:03:45.000+01:00","completed_at":"2023-02-17T17:03:48.000+01:00"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-02-17T17:03:48.000+01:00","completed_at":"2023-02-17T17:03:50.000+01:00"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-02-17T17:03:50.000+01:00","completed_at":"2023-02-17T17:03:50.000+01:00"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-02-17T17:03:51.000+01:00","completed_at":"2023-02-17T17:03:54.000+01:00"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-02-17T17:03:55.000+01:00","completed_at":"2023-02-17T17:04:47.000+01:00"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-02-17T17:04:47.000+01:00","completed_at":"2023-02-17T17:04:49.000+01:00"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-02-17T17:04:49.000+01:00","completed_at":"2023-02-17T17:04:49.000+01:00"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-02-17T17:04:49.000+01:00","completed_at":"2023-02-17T17:04:49.000+01:00"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-02-17T17:04:49.000+01:00","completed_at":"2023-02-17T17:04:49.000+01:00"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421878999","labels":["ubuntu-latest"],"runner_id":3,"runner_name":"GitHub Actions 3","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":11421879256,"run_id":4205440316,"workflow_name":"CI","head_branch":"tz-aware-2","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316","run_attempt":1,"node_id":"CR_kwDOGpsAJ88AAAACqMwL2A","head_sha":"06ec040b2eeef6c0316dd5abcda0608525a3f205","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421879256","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536762","status":"completed","conclusion":"success","created_at":"2023-02-17T16:03:40Z","started_at":"2023-02-17T16:03:45Z","completed_at":"2023-02-17T16:05:03Z","name":"test (Python 3.11-dev)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-02-17T17:03:45.000+01:00","completed_at":"2023-02-17T17:03:47.000+01:00"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-02-17T17:03:47.000+01:00","completed_at":"2023-02-17T17:03:49.000+01:00"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-02-17T17:03:49.000+01:00","completed_at":"2023-02-17T17:03:49.000+01:00"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-02-17T17:03:50.000+01:00","completed_at":"2023-02-17T17:03:56.000+01:00"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-02-17T17:03:57.000+01:00","completed_at":"2023-02-17T17:04:58.000+01:00"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-02-17T17:04:59.000+01:00","completed_at":"2023-02-17T17:05:00.000+01:00"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-02-17T17:05:01.000+01:00","completed_at":"2023-02-17T17:05:01.000+01:00"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-02-17T17:05:01.000+01:00","completed_at":"2023-02-17T17:05:01.000+01:00"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-02-17T17:05:01.000+01:00","completed_at":"2023-02-17T17:05:01.000+01:00"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421879256","labels":["ubuntu-latest"],"runner_id":1,"runner_name":"Hosted Agent","runner_group_id":2,"runner_group_name":"GitHub Actions"}]} + diff --git a/tests/ReplayData/WorkflowJob.testAttributes.txt b/tests/ReplayData/WorkflowJob.testAttributes.txt new file mode 100644 index 0000000000..ecdf525ea0 --- /dev/null +++ b/tests/ReplayData/WorkflowJob.testAttributes.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/jobs/11421878319/logs +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +302 +[('Server', 'GitHub.com'), ('Date', 'Wed, 15 Mar 2023 17:01:58 GMT'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Length', '0'), ('Location', 'https://pipelines.actions.githubusercontent.com/serviceHosts/d560a817-28d4-4544-a539-eb35c2a56899/_apis/pipelines/1/runs/5/signedlogcontent/5?urlExpires=2023-03-15T17%3A02%3A58.1305046Z&urlSigningMethod=HMACV1&urlSignature=abcdefghijklmn'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4996'), ('X-RateLimit-Reset', '1678903315'), ('X-RateLimit-Used', '4'), ('X-RateLimit-Resource', 'core'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Vary', 'Accept-Encoding, Accept, X-Requested-With'), ('X-GitHub-Request-Id', 'A66C:CC26:9983F9A:9BF3547:6411FA05')] + + diff --git a/tests/ReplayData/WorkflowRun.test_jobs.txt b/tests/ReplayData/WorkflowRun.test_jobs.txt new file mode 100644 index 0000000000..9d495bc602 --- /dev/null +++ b/tests/ReplayData/WorkflowRun.test_jobs.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/runs/3881497935/jobs +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Tue, 20 Jun 2023 06:27:04 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Cache-Control', 'public, max-age=60, s-maxage=60'), ('Vary', 'Accept, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"96a5512fe26678095c0e1664a413e79b9bafe00b1fb6cb939dd09afd530010ad"'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-RateLimit-Limit', '60'), ('X-RateLimit-Remaining', '37'), ('X-RateLimit-Reset', '1687245884'), ('X-RateLimit-Resource', 'core'), ('X-RateLimit-Used', '23'), ('Accept-Ranges', 'bytes'), ('Content-Length', '1275'), ('X-GitHub-Request-Id', '83BE:12914:3B912FB:3C20829:649146B8')] +{"total_count":5,"jobs":[{"id":10545727758,"run_id":3881497935,"workflow_name":"CI","head_branch":"feat/workflow-run","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3881497935","run_attempt":1,"node_id":"CR_kwDOADYVqs8AAAACdJMJDg","head_sha":"c6e5cac67a58a4eb11f1f28567a77a6e2cc8ee98","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/10545727758","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3881497935/jobs/6620564740","status":"completed","conclusion":"success","created_at":"2023-01-10T08:24:21Z","started_at":"2023-01-10T08:24:28Z","completed_at":"2023-01-10T08:25:28Z","name":"test (Python 3.7)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-01-10T08:24:27.000Z","completed_at":"2023-01-10T08:24:29.000Z"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-01-10T08:24:29.000Z","completed_at":"2023-01-10T08:24:31.000Z"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-01-10T08:24:31.000Z","completed_at":"2023-01-10T08:24:31.000Z"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-01-10T08:24:32.000Z","completed_at":"2023-01-10T08:24:38.000Z"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-01-10T08:24:38.000Z","completed_at":"2023-01-10T08:25:25.000Z"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-01-10T08:25:25.000Z","completed_at":"2023-01-10T08:25:27.000Z"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-01-10T08:25:27.000Z","completed_at":"2023-01-10T08:25:27.000Z"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-01-10T08:25:27.000Z","completed_at":"2023-01-10T08:25:27.000Z"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-01-10T08:25:27.000Z","completed_at":"2023-01-10T08:25:27.000Z"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/10545727758","labels":["ubuntu-latest"],"runner_id":1,"runner_name":"Hosted Agent","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":10545727888,"run_id":3881497935,"workflow_name":"CI","head_branch":"feat/workflow-run","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3881497935","run_attempt":1,"node_id":"CR_kwDOADYVqs8AAAACdJMJkA","head_sha":"c6e5cac67a58a4eb11f1f28567a77a6e2cc8ee98","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/10545727888","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3881497935/jobs/6620564849","status":"completed","conclusion":"success","created_at":"2023-01-10T08:24:21Z","started_at":"2023-01-10T08:24:30Z","completed_at":"2023-01-10T08:28:18Z","name":"test (Python 3.8)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-01-10T08:24:30.000Z","completed_at":"2023-01-10T08:24:49.000Z"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-01-10T08:24:49.000Z","completed_at":"2023-01-10T08:25:28.000Z"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-01-10T08:25:28.000Z","completed_at":"2023-01-10T08:25:28.000Z"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-01-10T08:25:28.000Z","completed_at":"2023-01-10T08:25:32.000Z"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-01-10T08:25:33.000Z","completed_at":"2023-01-10T08:28:14.000Z"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-01-10T08:28:15.000Z","completed_at":"2023-01-10T08:28:16.000Z"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-01-10T08:28:17.000Z","completed_at":"2023-01-10T08:28:17.000Z"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-01-10T08:28:17.000Z","completed_at":"2023-01-10T08:28:17.000Z"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-01-10T08:28:17.000Z","completed_at":"2023-01-10T08:28:17.000Z"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/10545727888","labels":["ubuntu-latest"],"runner_id":5,"runner_name":"GitHub Actions 5","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":10545728039,"run_id":3881497935,"workflow_name":"CI","head_branch":"feat/workflow-run","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3881497935","run_attempt":1,"node_id":"CR_kwDOADYVqs8AAAACdJMKJw","head_sha":"c6e5cac67a58a4eb11f1f28567a77a6e2cc8ee98","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/10545728039","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3881497935/jobs/6620564960","status":"completed","conclusion":"success","created_at":"2023-01-10T08:24:22Z","started_at":"2023-01-10T08:24:31Z","completed_at":"2023-01-10T08:25:30Z","name":"test (Python 3.9)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-01-10T08:24:30.000Z","completed_at":"2023-01-10T08:24:32.000Z"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-01-10T08:24:32.000Z","completed_at":"2023-01-10T08:24:34.000Z"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-01-10T08:24:35.000Z","completed_at":"2023-01-10T08:24:35.000Z"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-01-10T08:24:35.000Z","completed_at":"2023-01-10T08:24:39.000Z"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-01-10T08:24:39.000Z","completed_at":"2023-01-10T08:25:26.000Z"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-01-10T08:25:26.000Z","completed_at":"2023-01-10T08:25:28.000Z"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-01-10T08:25:30.000Z","completed_at":"2023-01-10T08:25:30.000Z"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-01-10T08:25:30.000Z","completed_at":"2023-01-10T08:25:30.000Z"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-01-10T08:25:29.000Z","completed_at":"2023-01-10T08:25:29.000Z"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/10545728039","labels":["ubuntu-latest"],"runner_id":4,"runner_name":"GitHub Actions 4","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":10545728190,"run_id":3881497935,"workflow_name":"CI","head_branch":"feat/workflow-run","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3881497935","run_attempt":1,"node_id":"CR_kwDOADYVqs8AAAACdJMKvg","head_sha":"c6e5cac67a58a4eb11f1f28567a77a6e2cc8ee98","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/10545728190","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3881497935/jobs/6620565085","status":"completed","conclusion":"success","created_at":"2023-01-10T08:24:22Z","started_at":"2023-01-10T08:24:28Z","completed_at":"2023-01-10T08:25:46Z","name":"test (Python 3.10)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-01-10T08:24:28.000Z","completed_at":"2023-01-10T08:24:30.000Z"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-01-10T08:24:30.000Z","completed_at":"2023-01-10T08:24:32.000Z"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-01-10T08:24:32.000Z","completed_at":"2023-01-10T08:24:32.000Z"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-01-10T08:24:34.000Z","completed_at":"2023-01-10T08:24:41.000Z"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-01-10T08:24:41.000Z","completed_at":"2023-01-10T08:25:40.000Z"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-01-10T08:25:41.000Z","completed_at":"2023-01-10T08:25:43.000Z"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-01-10T08:25:44.000Z","completed_at":"2023-01-10T08:25:44.000Z"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-01-10T08:25:44.000Z","completed_at":"2023-01-10T08:25:44.000Z"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-01-10T08:25:44.000Z","completed_at":"2023-01-10T08:25:44.000Z"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/10545728190","labels":["ubuntu-latest"],"runner_id":3,"runner_name":"GitHub Actions 3","runner_group_id":2,"runner_group_name":"GitHub Actions"},{"id":10545728356,"run_id":3881497935,"workflow_name":"CI","head_branch":"feat/workflow-run","run_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3881497935","run_attempt":1,"node_id":"CR_kwDOADYVqs8AAAACdJMLZA","head_sha":"c6e5cac67a58a4eb11f1f28567a77a6e2cc8ee98","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/10545728356","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3881497935/jobs/6620565227","status":"completed","conclusion":"success","created_at":"2023-01-10T08:24:22Z","started_at":"2023-01-10T08:24:31Z","completed_at":"2023-01-10T08:25:50Z","name":"test (Python 3.11-dev)","steps":[{"name":"Set up job","status":"completed","conclusion":"success","number":1,"started_at":"2023-01-10T08:24:30.000Z","completed_at":"2023-01-10T08:24:33.000Z"},{"name":"Run actions/checkout@v2","status":"completed","conclusion":"success","number":2,"started_at":"2023-01-10T08:24:33.000Z","completed_at":"2023-01-10T08:24:35.000Z"},{"name":"Set up Python","status":"completed","conclusion":"success","number":3,"started_at":"2023-01-10T08:24:35.000Z","completed_at":"2023-01-10T08:24:35.000Z"},{"name":"Install tox","status":"completed","conclusion":"success","number":4,"started_at":"2023-01-10T08:24:36.000Z","completed_at":"2023-01-10T08:24:41.000Z"},{"name":"Run tests","status":"completed","conclusion":"success","number":5,"started_at":"2023-01-10T08:24:41.000Z","completed_at":"2023-01-10T08:25:45.000Z"},{"name":"Upload coverage to Codecov","status":"completed","conclusion":"success","number":6,"started_at":"2023-01-10T08:25:45.000Z","completed_at":"2023-01-10T08:25:48.000Z"},{"name":"Post Set up Python","status":"completed","conclusion":"success","number":11,"started_at":"2023-01-10T08:25:48.000Z","completed_at":"2023-01-10T08:25:48.000Z"},{"name":"Post Run actions/checkout@v2","status":"completed","conclusion":"success","number":12,"started_at":"2023-01-10T08:25:48.000Z","completed_at":"2023-01-10T08:25:48.000Z"},{"name":"Complete job","status":"completed","conclusion":"success","number":13,"started_at":"2023-01-10T08:25:48.000Z","completed_at":"2023-01-10T08:25:48.000Z"}],"check_run_url":"https://api.github.com/repos/PyGithub/PyGithub/check-runs/10545728356","labels":["ubuntu-latest"],"runner_id":2,"runner_name":"GitHub Actions 2","runner_group_id":2,"runner_group_name":"GitHub Actions"}]} + diff --git a/tests/WorkflowJob.py b/tests/WorkflowJob.py new file mode 100644 index 0000000000..7722a8ba9a --- /dev/null +++ b/tests/WorkflowJob.py @@ -0,0 +1,80 @@ +############################ Copyrights and license ############################ +# # +# Copyright 2021 Jeppe Fihl-Pearson # +# # +# This file is part of PyGithub. # +# http://pygithub.readthedocs.io/ # +# # +# PyGithub is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Lesser General Public License as published by the Free # +# Software Foundation, either version 3 of the License, or (at your option) # +# any later version. # +# # +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # +# details. # +# # +# You should have received a copy of the GNU Lesser General Public License # +# along with PyGithub. If not, see . # +# # +################################################################################ + +import datetime + +from . import Framework + + +class WorkflowJob(Framework.TestCase): + def setUp(self): + super().setUp() + self.repo = self.g.get_repo("PyGithub/PyGithub") + self.job = self.repo.get_workflow_run(4205440316).jobs()[0] + + def testAttributes(self): + self.assertEqual(self.job.id, 11421878319) + self.assertEqual(self.job.run_id, 4205440316) + self.assertEqual( + self.job.run_url, + "https://api.github.com/repos/PyGithub/PyGithub/actions/runs/4205440316", + ) + self.assertEqual(self.job.node_id, "CR_kwDOGpsAJ88AAAACqMwILw") + self.assertEqual(self.job.head_sha, "06ec040b2eeef6c0316dd5abcda0608525a3f205") + self.assertEqual( + self.job.url, + "https://api.github.com/repos/PyGithub/PyGithub/actions/jobs/11421878319", + ) + self.assertEqual( + self.job.html_url, + "https://github.com/PyGithub/PyGithub/actions/runs/4205440316/jobs/7297536068", + ) + self.assertEqual(self.job.status, "completed") + self.assertEqual(self.job.conclusion, "success") + started_at = datetime.datetime(2023, 2, 17, 16, 3, 46) + self.assertEqual(self.job.started_at, started_at) + completed_at = datetime.datetime(2023, 2, 17, 16, 4, 52) + self.assertEqual(self.job.completed_at, completed_at) + self.assertEqual(self.job.name, "test (Python 3.7)") + self.assertEqual( + self.job.check_run_url, + "https://api.github.com/repos/PyGithub/PyGithub/check-runs/11421878319", + ) + self.assertListKeyEqual( + self.job.steps, + lambda s: s.name, + [ + "Set up job", + "Run actions/checkout@v2", + "Set up Python", + "Install tox", + "Run tests", + "Upload coverage to Codecov", + "Post Set up Python", + "Post Run actions/checkout@v2", + "Complete job", + ], + ) + self.assertEqual( + self.job.logs_url(), + "https://pipelines.actions.githubusercontent.com/serviceHosts/d560a817-28d4-4544-a539-eb35c2a56899/_apis/pipelines/1/runs/5/signedlogcontent/5?urlExpires=2023-03-15T17%3A02%3A58.1305046Z&urlSigningMethod=HMACV1&urlSignature=abcdefghijklmn", + ) diff --git a/tests/WorkflowRun.py b/tests/WorkflowRun.py index 42f5d9c081..0b6054d79e 100644 --- a/tests/WorkflowRun.py +++ b/tests/WorkflowRun.py @@ -135,3 +135,10 @@ def test_cancel(self): def test_delete(self): wr = self.repo.get_workflow_run(3881497935) self.assertFalse(wr.delete()) + + def test_jobs(self): + self.assertListKeyEqual( + self.workflow_run.jobs(), + lambda j: j.id, + [10545727758, 10545727888, 10545728039, 10545728190, 10545728356], + )