From 252c27a219f2d729c416f4599035075d87ad37e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eliezer=20Gonz=C3=A1lez?= Date: Thu, 29 Oct 2026 12:13:22 +0000 Subject: [PATCH] :bug: Fix: workflow_job completed step status can be pending (#334) --- .../v2022_11_28/models/group_1035.py | 2 +- .../v2022_11_28/models/group_1036.py | 2 +- .../v2022_11_28/types/group_1035.py | 4 +- .../v2022_11_28/types/group_1036.py | 4 +- .../v2026_03_10/models/group_1034.py | 2 +- .../v2026_03_10/models/group_1035.py | 2 +- .../v2026_03_10/types/group_1034.py | 4 +- .../v2026_03_10/types/group_1035.py | 4 +- .../ghec_v2022_11_28/models/group_1139.py | 2 +- .../ghec_v2022_11_28/models/group_1140.py | 2 +- .../ghec_v2022_11_28/types/group_1139.py | 4 +- .../ghec_v2022_11_28/types/group_1140.py | 4 +- .../ghec_v2026_03_10/models/group_1138.py | 2 +- .../ghec_v2026_03_10/models/group_1139.py | 2 +- .../ghec_v2026_03_10/types/group_1138.py | 4 +- .../ghec_v2026_03_10/types/group_1139.py | 4 +- .../githubkit_schemas/versions.lock | 1 + pyproject.toml | 5 + .../assets/workflow_job_completed.json | 195 ++++++++++++++++++ tests/test_webhooks/test_parse.py | 13 +- 20 files changed, 237 insertions(+), 25 deletions(-) create mode 100644 tests/test_webhooks/assets/workflow_job_completed.json diff --git a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1035.py b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1035.py index a681af6379..e94ed7bbb3 100644 --- a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1035.py +++ b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1035.py @@ -119,7 +119,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedSteps(GitHubModel): name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompleted) diff --git a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1036.py b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1036.py index 311ab1c7b8..87e64f2ab7 100644 --- a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1036.py +++ b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/models/group_1036.py @@ -83,7 +83,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItems(GitHubModel name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompletedPropWorkflowJobAllof0) diff --git a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1035.py b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1035.py index be43e49c44..78354532bf 100644 --- a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1035.py +++ b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1035.py @@ -129,7 +129,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsType(TypedDict): name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(TypedDict): @@ -140,7 +140,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(Typed name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1036.py b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1036.py index 6c964ea425..522657276c 100644 --- a/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1036.py +++ b/packages/githubkit-schemas-2022-11-28/githubkit_schemas/v2022_11_28/types/group_1036.py @@ -109,7 +109,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsType(TypedDi name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForResponse( @@ -122,7 +122,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForRespo name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1034.py b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1034.py index 819203ff29..21ed07fa2a 100644 --- a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1034.py +++ b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1034.py @@ -119,7 +119,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedSteps(GitHubModel): name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompleted) diff --git a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1035.py b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1035.py index 311ab1c7b8..87e64f2ab7 100644 --- a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1035.py +++ b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/models/group_1035.py @@ -83,7 +83,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItems(GitHubModel name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompletedPropWorkflowJobAllof0) diff --git a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1034.py b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1034.py index f6c7185dc1..7bea3591dc 100644 --- a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1034.py +++ b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1034.py @@ -129,7 +129,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsType(TypedDict): name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(TypedDict): @@ -140,7 +140,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(Typed name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1035.py b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1035.py index 6c964ea425..522657276c 100644 --- a/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1035.py +++ b/packages/githubkit-schemas-2026-03-10/githubkit_schemas/v2026_03_10/types/group_1035.py @@ -109,7 +109,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsType(TypedDi name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForResponse( @@ -122,7 +122,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForRespo name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1139.py b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1139.py index 422f66adb7..2959e16c49 100644 --- a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1139.py +++ b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1139.py @@ -119,7 +119,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedSteps(GitHubModel): name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompleted) diff --git a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1140.py b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1140.py index c5c5451116..9862e3dffc 100644 --- a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1140.py +++ b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/models/group_1140.py @@ -83,7 +83,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItems(GitHubModel name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompletedPropWorkflowJobAllof0) diff --git a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1139.py b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1139.py index eb30196ef8..c6f4ae92e8 100644 --- a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1139.py +++ b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1139.py @@ -129,7 +129,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsType(TypedDict): name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(TypedDict): @@ -140,7 +140,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(Typed name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1140.py b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1140.py index 6c964ea425..522657276c 100644 --- a/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1140.py +++ b/packages/githubkit-schemas-ghec-2022-11-28/githubkit_schemas/ghec_v2022_11_28/types/group_1140.py @@ -109,7 +109,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsType(TypedDi name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForResponse( @@ -122,7 +122,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForRespo name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1138.py b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1138.py index bc4d0d2aa1..423a45d6a7 100644 --- a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1138.py +++ b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1138.py @@ -119,7 +119,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedSteps(GitHubModel): name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompleted) diff --git a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1139.py b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1139.py index c5c5451116..9862e3dffc 100644 --- a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1139.py +++ b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/models/group_1139.py @@ -83,7 +83,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItems(GitHubModel name: str = Field() number: int = Field() started_at: Union[str, None] = Field() - status: Literal["in_progress", "completed", "queued"] = Field() + status: Literal["in_progress", "completed", "queued", "pending"] = Field() model_rebuild(WebhookWorkflowJobCompletedPropWorkflowJobAllof0) diff --git a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1138.py b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1138.py index dc6a2d72ef..3238b07208 100644 --- a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1138.py +++ b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1138.py @@ -129,7 +129,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsType(TypedDict): name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(TypedDict): @@ -140,7 +140,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobMergedStepsTypeForResponse(Typed name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1139.py b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1139.py index 6c964ea425..522657276c 100644 --- a/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1139.py +++ b/packages/githubkit-schemas-ghec-2026-03-10/githubkit_schemas/ghec_v2026_03_10/types/group_1139.py @@ -109,7 +109,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsType(TypedDi name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForResponse( @@ -122,7 +122,7 @@ class WebhookWorkflowJobCompletedPropWorkflowJobAllof0PropStepsItemsTypeForRespo name: str number: int started_at: Union[str, None] - status: Literal["in_progress", "completed", "queued"] + status: Literal["in_progress", "completed", "queued", "pending"] __all__ = ( diff --git a/packages/githubkit-schemas/githubkit_schemas/versions.lock b/packages/githubkit-schemas/githubkit_schemas/versions.lock index 976edc79c1..85d7af602e 100644 --- a/packages/githubkit-schemas/githubkit_schemas/versions.lock +++ b/packages/githubkit-schemas/githubkit_schemas/versions.lock @@ -165,6 +165,7 @@ target_descriptions = ["ghec-2022-11-28", "ghec-2026-03-10"] "/components/schemas/webhook-workflow-job-in-progress/properties/workflow_job/allOf/0/properties/run_id" = {type = "integer"} "/components/schemas/webhook-workflow-job-queued/properties/workflow_job/properties/run_id" = {type = "integer"} "/components/schemas/webhook-workflow-job-waiting/properties/workflow_job/properties/run_id" = {type = "integer"} +"/components/schemas/webhook-workflow-job-completed/properties/workflow_job/allOf/0/properties/steps/items/properties/status/enum" = {"" = ["pending"]} "/components/schemas/webhook-workflow-job-completed/properties/workflow_job/allOf/1/properties/runner_id" = {type = ["integer", "null"]} "/components/schemas/webhook-workflow-job-in-progress/properties/workflow_job/allOf/1/properties/runner_id" = {type = ["integer", "null"]} "/components/schemas/webhook-workflow-job-completed/properties/workflow_job/allOf/1/properties/runner_group_id" = {type = ["integer", "null"]} diff --git a/pyproject.toml b/pyproject.toml index be937588cc..2947215b6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -632,6 +632,11 @@ target_descriptions = ["ghec-2022-11-28", "ghec-2026-03-10"] "/components/schemas/webhook-workflow-job-in-progress/properties/workflow_job/allOf/0/properties/run_id" = { type = "integer" } "/components/schemas/webhook-workflow-job-queued/properties/workflow_job/properties/run_id" = { type = "integer" } "/components/schemas/webhook-workflow-job-waiting/properties/workflow_job/properties/run_id" = { type = "integer" } +# webhook workflow job completed steps can still report "pending" status +# https://github.com/yanyongyu/githubkit/issues/334 +"/components/schemas/webhook-workflow-job-completed/properties/workflow_job/allOf/0/properties/steps/items/properties/status/enum" = { "" = [ + "pending", +] } # webhook workflow job runner_id should be integer "/components/schemas/webhook-workflow-job-completed/properties/workflow_job/allOf/1/properties/runner_id" = { type = [ "integer", diff --git a/tests/test_webhooks/assets/workflow_job_completed.json b/tests/test_webhooks/assets/workflow_job_completed.json new file mode 100644 index 0000000000..480924af06 --- /dev/null +++ b/tests/test_webhooks/assets/workflow_job_completed.json @@ -0,0 +1,195 @@ +{ + "action": "completed", + "workflow_job": { + "id": 900008001, + "run_id": 900007001, + "workflow_name": "Refresh Portfolio Data", + "head_branch": "main", + "run_url": "https://api.github.com/repos/example-org/example-repo/actions/runs/900007001", + "run_attempt": 1, + "node_id": "ANONYMIZED_NODE_ID", + "head_sha": "0000000000000000000000000000000000000000", + "url": "https://api.github.com/repos/example-org/example-repo/actions/jobs/900008001", + "html_url": "https://github.com/example-org/example-repo/actions/runs/900007001/job/900008001", + "status": "completed", + "conclusion": "success", + "created_at": "2026-10-13T22:43:21Z", + "started_at": "2026-10-13T22:43:23Z", + "completed_at": "2026-10-13T22:44:17Z", + "name": "refresh", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-10-13T22:43:24Z", + "completed_at": "2026-10-13T22:43:26Z" + }, + { + "name": "Run actions/checkout@v4", + "status": "in_progress", + "conclusion": null, + "number": 2, + "started_at": "2026-10-13T22:43:26Z", + "completed_at": null + }, + { + "name": "Post Run actions/checkout@v4", + "status": "pending", + "conclusion": null, + "number": 14, + "started_at": null, + "completed_at": null + } + ], + "check_run_url": "https://api.github.com/repos/example-org/example-repo/check-runs/900008001", + "labels": [ + "ubuntu-latest" + ], + "runner_id": 900006001, + "runner_name": "GitHub Actions 900006001", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + "repository": { + "id": 512138996, + "node_id": "R_kgDOHoae9A", + "name": "githubkit", + "full_name": "yanyongyu/githubkit", + "private": false, + "owner": { + "name": "yanyongyu", + "email": "42488585+yanyongyu@users.noreply.github.com", + "login": "yanyongyu", + "id": 42488585, + "node_id": "MDQ6VXNlcjQyNDg4NTg1", + "avatar_url": "https://avatars.githubusercontent.com/u/42488585?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/yanyongyu", + "html_url": "https://github.com/yanyongyu", + "followers_url": "https://api.github.com/users/yanyongyu/followers", + "following_url": "https://api.github.com/users/yanyongyu/following{/other_user}", + "gists_url": "https://api.github.com/users/yanyongyu/gists{/gist_id}", + "starred_url": "https://api.github.com/users/yanyongyu/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/yanyongyu/subscriptions", + "organizations_url": "https://api.github.com/users/yanyongyu/orgs", + "repos_url": "https://api.github.com/users/yanyongyu/repos", + "events_url": "https://api.github.com/users/yanyongyu/events{/privacy}", + "received_events_url": "https://api.github.com/users/yanyongyu/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/yanyongyu/githubkit", + "description": "The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!", + "fork": false, + "url": "https://github.com/yanyongyu/githubkit", + "forks_url": "https://api.github.com/repos/yanyongyu/githubkit/forks", + "keys_url": "https://api.github.com/repos/yanyongyu/githubkit/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/yanyongyu/githubkit/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/yanyongyu/githubkit/teams", + "hooks_url": "https://api.github.com/repos/yanyongyu/githubkit/hooks", + "issue_events_url": "https://api.github.com/repos/yanyongyu/githubkit/issues/events{/number}", + "events_url": "https://api.github.com/repos/yanyongyu/githubkit/events", + "assignees_url": "https://api.github.com/repos/yanyongyu/githubkit/assignees{/user}", + "branches_url": "https://api.github.com/repos/yanyongyu/githubkit/branches{/branch}", + "tags_url": "https://api.github.com/repos/yanyongyu/githubkit/tags", + "blobs_url": "https://api.github.com/repos/yanyongyu/githubkit/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/yanyongyu/githubkit/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/yanyongyu/githubkit/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/yanyongyu/githubkit/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/yanyongyu/githubkit/statuses/{sha}", + "languages_url": "https://api.github.com/repos/yanyongyu/githubkit/languages", + "stargazers_url": "https://api.github.com/repos/yanyongyu/githubkit/stargazers", + "contributors_url": "https://api.github.com/repos/yanyongyu/githubkit/contributors", + "subscribers_url": "https://api.github.com/repos/yanyongyu/githubkit/subscribers", + "subscription_url": "https://api.github.com/repos/yanyongyu/githubkit/subscription", + "commits_url": "https://api.github.com/repos/yanyongyu/githubkit/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/yanyongyu/githubkit/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/yanyongyu/githubkit/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/yanyongyu/githubkit/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/yanyongyu/githubkit/contents/{+path}", + "compare_url": "https://api.github.com/repos/yanyongyu/githubkit/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/yanyongyu/githubkit/merges", + "archive_url": "https://api.github.com/repos/yanyongyu/githubkit/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/yanyongyu/githubkit/downloads", + "issues_url": "https://api.github.com/repos/yanyongyu/githubkit/issues{/number}", + "pulls_url": "https://api.github.com/repos/yanyongyu/githubkit/pulls{/number}", + "milestones_url": "https://api.github.com/repos/yanyongyu/githubkit/milestones{/number}", + "notifications_url": "https://api.github.com/repos/yanyongyu/githubkit/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/yanyongyu/githubkit/labels{/name}", + "releases_url": "https://api.github.com/repos/yanyongyu/githubkit/releases{/id}", + "deployments_url": "https://api.github.com/repos/yanyongyu/githubkit/deployments", + "created_at": 1657356935, + "updated_at": "2023-12-23T04:42:22Z", + "pushed_at": 1703753251, + "git_url": "git://github.com/yanyongyu/githubkit.git", + "ssh_url": "git@github.com:yanyongyu/githubkit.git", + "clone_url": "https://github.com/yanyongyu/githubkit.git", + "svn_url": "https://github.com/yanyongyu/githubkit", + "homepage": "", + "size": 2947, + "stargazers_count": 107, + "watchers_count": 107, + "language": "Python", + "has_issues": true, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 16, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 6, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + "async", + "github", + "github-api", + "github-sdk", + "httpx", + "octokit", + "pydantic", + "python", + "sync" + ], + "visibility": "public", + "forks": 16, + "open_issues": 6, + "watchers": 107, + "default_branch": "master", + "stargazers": 107, + "master_branch": "master" + }, + "sender": { + "login": "dependabot[bot]", + "id": 49699333, + "node_id": "MDM6Qm90NDk2OTkzMzM=", + "avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dependabot%5Bbot%5D", + "html_url": "https://github.com/apps/dependabot", + "followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events", + "type": "Bot", + "site_admin": false + } +} diff --git a/tests/test_webhooks/test_parse.py b/tests/test_webhooks/test_parse.py index 4ce7d9dd73..daae6e62a4 100644 --- a/tests/test_webhooks/test_parse.py +++ b/tests/test_webhooks/test_parse.py @@ -3,7 +3,11 @@ from typing import Any from githubkit_schemas.core import LATEST_VERSION -from githubkit_schemas.latest.models import WebhookPullRequestOpened, WebhookPush +from githubkit_schemas.latest.models import ( + WebhookPullRequestOpened, + WebhookPush, + WebhookWorkflowJobCompleted, +) from githubkit_schemas.latest.webhooks import EventNameType import pytest @@ -28,6 +32,13 @@ ), WebhookPullRequestOpened, ), + ( + "workflow_job", + (Path(__file__).parent / "assets/workflow_job_completed.json").read_text( + encoding="utf-8" + ), + WebhookWorkflowJobCompleted, + ), ]