diff --git a/github/Repository.py b/github/Repository.py index 94379fb258..fd0c4a1843 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -3344,6 +3344,8 @@ def get_workflow_runs( status: Opt[str] = NotSet, exclude_pull_requests: Opt[bool] = NotSet, head_sha: Opt[str] = NotSet, + created: Opt[str] = NotSet, + check_suite_id: Opt[int] = NotSet, ) -> PaginatedList[WorkflowRun]: """ :calls: `GET /repos/{owner}/{repo}/actions/runs `_ @@ -3353,6 +3355,8 @@ def get_workflow_runs( :param status: string `queued`, `in_progress`, `completed`, `success`, `failure`, `neutral`, `cancelled`, `skipped`, `timed_out`, or `action_required` :param exclude_pull_requests: bool :param head_sha: string + :param created: string Created filter, see https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates + :param check_suite_id: int :rtype: :class:`PaginatedList` of :class:`github.WorkflowRun.WorkflowRun` """ @@ -3362,6 +3366,8 @@ def get_workflow_runs( assert is_optional(status, str), status assert is_optional(exclude_pull_requests, bool), exclude_pull_requests assert is_optional(head_sha, str), head_sha + assert is_optional(created, str), created + assert is_optional(check_suite_id, int), check_suite_id url_parameters: dict[str, Any] = {} if is_defined(actor): @@ -3382,6 +3388,10 @@ def get_workflow_runs( url_parameters["exclude_pull_requests"] = 1 if is_defined(head_sha): url_parameters["head_sha"] = head_sha + if is_defined(created): + url_parameters["created"] = created + if is_defined(check_suite_id): + url_parameters["check_suite_id"] = check_suite_id return PaginatedList( github.WorkflowRun.WorkflowRun, diff --git a/tests/ReplayData/Repository.testGetWorkflowRunsCreated.txt b/tests/ReplayData/Repository.testGetWorkflowRunsCreated.txt new file mode 100644 index 0000000000..2ddcac29d1 --- /dev/null +++ b/tests/ReplayData/Repository.testGetWorkflowRunsCreated.txt @@ -0,0 +1,21 @@ +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', 'Thu, 01 Feb 2024 12:09:42 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/"afad6da141600197f48648aea815caa9122a7a21d2ffd08a9f1f88f71fcefce6"'), ('Last-Modified', 'Thu, 01 Feb 2024 11:21:11 GMT'), ('X-OAuth-Scopes', 'repo'), ('X-Accepted-OAuth-Scopes', 'repo'), ('github-authentication-token-expiration', '2024-02-23 19:07:32 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4997'), ('X-RateLimit-Reset', '1706792982'), ('X-RateLimit-Used', '3'), ('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', 'B621:D6070:4412ACB:44D2A3D:65BB8A06')] +{"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":"2024-02-01T11:21:11Z","pushed_at":"2024-02-01T11:03:04Z","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":15666,"stargazers_count":6506,"watchers_count":6506,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":true,"forks_count":1719,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":275,"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":1719,"open_issues":275,"watchers":6506,"default_branch":"main","permissions":{"admin":false,"maintain":false,"push":false,"triage":false,"pull":true},"temp_clone_token":"","custom_properties":{},"organization":{"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},"network_count":1719,"subscribers_count":111} + +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/runs?created=2022-12-24 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 01 Feb 2024 12:09:43 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/"de506f1de78297cd93346ec22d4d061f087a4dddaa4aa5241faabc18ee3cc923"'), ('X-OAuth-Scopes', 'repo'), ('X-Accepted-OAuth-Scopes', ''), ('github-authentication-token-expiration', '2024-02-23 19:07:32 UTC'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4996'), ('X-RateLimit-Reset', '1706792982'), ('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'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'B622:2C9777:B82985F:BA03798:65BB8A06')] +{"total_count":1,"workflow_runs":[{"id":3770390952,"name":"CI","node_id":"WFR_kwLOADYVqs7gu5mo","head_branch":"patch-1","head_sha":"84e26cfaa0eede8179f34272f03afa28d76a07a7","path":".github/workflows/ci.yml","display_title":"CI: Update action actions/setup-python","run_number":916,"event":"pull_request","status":"completed","conclusion":"success","workflow_id":1903133,"check_suite_id":10039322119,"check_suite_node_id":"CS_kwDOADYVqs8AAAACVmPmBw","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3770390952","pull_requests":[],"created_at":"2022-12-24T07:29:12Z","updated_at":"2024-01-29T23:29:45Z","actor":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"run_attempt":1,"referenced_workflows":[],"run_started_at":"2022-12-24T07:29:12Z","triggering_actor":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"jobs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/jobs","logs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/logs","check_suite_url":"https://api.github.com/repos/PyGithub/PyGithub/check-suites/10039322119","artifacts_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/artifacts","cancel_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/cancel","rerun_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/rerun","previous_attempt_url":null,"workflow_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/workflows/1903133","head_commit":{"id":"84e26cfaa0eede8179f34272f03afa28d76a07a7","tree_id":"a0a51aff2b432542f78e9484272ac779ecd8f219","message":"Merge branch 'master' into patch-1","timestamp":"2022-12-24T07:29:07Z","author":{"name":"Christian Clauss","email":"cclauss@me.com"},"committer":{"name":"GitHub","email":"noreply@github.com"}},"repository":{"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"},"head_repository":{"id":30936332,"node_id":"MDEwOlJlcG9zaXRvcnkzMDkzNjMzMg==","name":"PyGithub","full_name":"cclauss/PyGithub","private":false,"owner":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cclauss/PyGithub","description":"Python library implementing the full GitHub API v3","fork":true,"url":"https://api.github.com/repos/cclauss/PyGithub","forks_url":"https://api.github.com/repos/cclauss/PyGithub/forks","keys_url":"https://api.github.com/repos/cclauss/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cclauss/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cclauss/PyGithub/teams","hooks_url":"https://api.github.com/repos/cclauss/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/cclauss/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/cclauss/PyGithub/events","assignees_url":"https://api.github.com/repos/cclauss/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/cclauss/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/cclauss/PyGithub/tags","blobs_url":"https://api.github.com/repos/cclauss/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cclauss/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cclauss/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/cclauss/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cclauss/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/cclauss/PyGithub/languages","stargazers_url":"https://api.github.com/repos/cclauss/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/cclauss/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/cclauss/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/cclauss/PyGithub/subscription","commits_url":"https://api.github.com/repos/cclauss/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/cclauss/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/cclauss/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/cclauss/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/cclauss/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/cclauss/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cclauss/PyGithub/merges","archive_url":"https://api.github.com/repos/cclauss/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cclauss/PyGithub/downloads","issues_url":"https://api.github.com/repos/cclauss/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/cclauss/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/cclauss/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/cclauss/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cclauss/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/cclauss/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/cclauss/PyGithub/deployments"}}]} diff --git a/tests/ReplayData/Workflow.testGetRunsWithCreated.txt b/tests/ReplayData/Workflow.testGetRunsWithCreated.txt new file mode 100644 index 0000000000..ada4346fbc --- /dev/null +++ b/tests/ReplayData/Workflow.testGetRunsWithCreated.txt @@ -0,0 +1,10 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/actions/workflows/1026390/runs?created=2022-12-24 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Sun, 25 Dec 2022 09:19:18 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'public, max-age=60, s-maxage=60'), ('Vary', 'Accept, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"466569f303915b04b955e89a3d37b92736baf3a881558c556c40bacc9cf6cf7a"'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('x-github-api-version-selected', '2022-11-28'), ('X-RateLimit-Limit', '60'), ('X-RateLimit-Remaining', '27'), ('X-RateLimit-Reset', '1671961520'), ('X-RateLimit-Used', '33'), ('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', '6903:7828:147F8C9:15F2E9E:63A81595')] +{"total_count":1,"workflow_runs":[{"id":3770390952,"name":"CI","node_id":"WFR_kwLOADYVqs7gu5mo","head_branch":"patch-1","head_sha":"84e26cfaa0eede8179f34272f03afa28d76a07a7","path":".github/workflows/check.yml","display_title":"CI: Upgrade to Python 3.11 production release","run_number":916,"event":"pull_request","status":"completed","conclusion":"success","workflow_id":1903133,"check_suite_id":10039322119,"check_suite_node_id":"CS_kwDOADYVqs8AAAACVmPmBw","url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952","html_url":"https://github.com/PyGithub/PyGithub/actions/runs/3770390952","pull_requests":[],"created_at":"2022-12-24T07:29:12Z","updated_at":"2022-12-24T07:31:39Z","actor":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"run_attempt":1,"referenced_workflows":[],"run_started_at":"2022-12-24T07:29:12Z","triggering_actor":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"jobs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/jobs","logs_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/logs","check_suite_url":"https://api.github.com/repos/PyGithub/PyGithub/check-suites/10039322119","artifacts_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/artifacts","cancel_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/cancel","rerun_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/runs/3770390952/rerun","previous_attempt_url":null,"workflow_url":"https://api.github.com/repos/PyGithub/PyGithub/actions/workflows/1903133","head_commit":{"id":"84e26cfaa0eede8179f34272f03afa28d76a07a7","tree_id":"a0a51aff2b432542f78e9484272ac779ecd8f219","message":"Merge branch 'master' into patch-1","timestamp":"2022-12-24T07:29:07Z","author":{"name":"Christian Clauss","email":"cclauss@me.com"},"committer":{"name":"GitHub","email":"noreply@github.com"}},"repository":{"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"},"head_repository":{"id":30936332,"node_id":"MDEwOlJlcG9zaXRvcnkzMDkzNjMzMg==","name":"PyGithub","full_name":"cclauss/PyGithub","private":false,"owner":{"login":"cclauss","id":3709715,"node_id":"MDQ6VXNlcjM3MDk3MTU=","avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=4","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cclauss/PyGithub","description":"Python library implementing the full GitHub API v3","fork":true,"url":"https://api.github.com/repos/cclauss/PyGithub","forks_url":"https://api.github.com/repos/cclauss/PyGithub/forks","keys_url":"https://api.github.com/repos/cclauss/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cclauss/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cclauss/PyGithub/teams","hooks_url":"https://api.github.com/repos/cclauss/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/cclauss/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/cclauss/PyGithub/events","assignees_url":"https://api.github.com/repos/cclauss/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/cclauss/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/cclauss/PyGithub/tags","blobs_url":"https://api.github.com/repos/cclauss/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cclauss/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cclauss/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/cclauss/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cclauss/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/cclauss/PyGithub/languages","stargazers_url":"https://api.github.com/repos/cclauss/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/cclauss/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/cclauss/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/cclauss/PyGithub/subscription","commits_url":"https://api.github.com/repos/cclauss/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/cclauss/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/cclauss/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/cclauss/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/cclauss/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/cclauss/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cclauss/PyGithub/merges","archive_url":"https://api.github.com/repos/cclauss/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cclauss/PyGithub/downloads","issues_url":"https://api.github.com/repos/cclauss/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/cclauss/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/cclauss/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/cclauss/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cclauss/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/cclauss/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/cclauss/PyGithub/deployments"}}]} diff --git a/tests/Repository.py b/tests/Repository.py index 6454798276..18539db9a8 100644 --- a/tests/Repository.py +++ b/tests/Repository.py @@ -1229,6 +1229,13 @@ def testGetWorkflowRuns(self): [110932306, 110932159, 110932072, 110286191, 110278769], ) + def testGetWorkflowRunsCreated(self): + self.assertListKeyEqual( + self.g.get_repo("PyGithub/PyGithub").get_workflow_runs(created="2022-12-24"), + lambda r: r.id, + [3770390952], + ) + def testGetSourceImport(self): import_repo = self.g.get_user("brix4dayz").get_repo("source-import-test") source_import = import_repo.get_source_import() diff --git a/tests/Workflow.py b/tests/Workflow.py index e1302635a8..696ca1d582 100644 --- a/tests/Workflow.py +++ b/tests/Workflow.py @@ -99,6 +99,13 @@ def testGetRunsWithHeadSha(self): [3349872717], ) + def testGetRunsWithCreated(self): + self.assertListKeyEqual( + self.workflow.get_runs(created="2022-12-24"), + lambda r: r.id, + [3770390952], + ) + def testCreateDispatchWithBranch(self): dispatch_inputs = {"logLevel": "Warning", "message": "Log Message"} workflow = self.g.get_repo("wrecker/PyGithub").get_workflow("manual_dispatch.yml")