From efeb2c9885c5079789214b839ad0c82e520cb9d0 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Mon, 6 Jan 2025 15:56:15 +0000 Subject: [PATCH] Fix: workflow_run pull_requests id/number types The webhook payload for the workflow_run event types (completed, in-progress & requested) each define the id and number of pull requests as `number` where they clearly should be `integer` values. --- githubkit/versions/ghec_v2022_11_28/models/group_0266.py | 7 +++++++ githubkit/versions/ghec_v2022_11_28/models/group_0836.py | 4 ++-- githubkit/versions/ghec_v2022_11_28/models/group_0837.py | 4 ++-- githubkit/versions/ghec_v2022_11_28/models/group_0838.py | 4 ++-- githubkit/versions/ghec_v2022_11_28/types/group_0266.py | 2 ++ githubkit/versions/ghec_v2022_11_28/types/group_0836.py | 4 ++-- githubkit/versions/ghec_v2022_11_28/types/group_0837.py | 4 ++-- githubkit/versions/ghec_v2022_11_28/types/group_0838.py | 4 ++-- githubkit/versions/v2022_11_28/models/group_0229.py | 7 +++++++ githubkit/versions/v2022_11_28/models/group_0778.py | 4 ++-- githubkit/versions/v2022_11_28/models/group_0779.py | 4 ++-- githubkit/versions/v2022_11_28/models/group_0780.py | 4 ++-- githubkit/versions/v2022_11_28/types/group_0229.py | 2 ++ githubkit/versions/v2022_11_28/types/group_0778.py | 4 ++-- githubkit/versions/v2022_11_28/types/group_0779.py | 4 ++-- githubkit/versions/v2022_11_28/types/group_0780.py | 4 ++-- pyproject.toml | 9 +++++++++ 17 files changed, 51 insertions(+), 24 deletions(-) diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0266.py b/githubkit/versions/ghec_v2022_11_28/models/group_0266.py index 03cea3fc..db0cf7ba 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0266.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0266.py @@ -46,6 +46,13 @@ class CodeScanningDefaultSetup(GitHubModel): ] ] ] = Field(default=UNSET, description="Languages to be analyzed.") + runner_type: Missing[Union[None, Literal["standard", "labeled"]]] = Field( + default=UNSET, description="Runner type to be used." + ) + runner_label: Missing[Union[str, None]] = Field( + default=UNSET, + description="Runner label to be used if the runner type is labeled.", + ) query_suite: Missing[Literal["default", "extended"]] = Field( default=UNSET, description="CodeQL query suite to be used." ) diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0836.py b/githubkit/versions/ghec_v2022_11_28/models/group_0836.py index 033b58c2..84a5636f 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0836.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0836.py @@ -413,8 +413,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItems(GitHubMode head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0837.py b/githubkit/versions/ghec_v2022_11_28/models/group_0837.py index be724326..0bb510a2 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0837.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0837.py @@ -402,8 +402,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItems(GitHubMod head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0838.py b/githubkit/versions/ghec_v2022_11_28/models/group_0838.py index e83a8ec9..5a121d57 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0838.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0838.py @@ -410,8 +410,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItems(GitHubMode head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0266.py b/githubkit/versions/ghec_v2022_11_28/types/group_0266.py index 051633e0..6a3c39b9 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0266.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0266.py @@ -38,6 +38,8 @@ class CodeScanningDefaultSetupType(TypedDict): ] ] ] + runner_type: NotRequired[Union[None, Literal["standard", "labeled"]]] + runner_label: NotRequired[Union[str, None]] query_suite: NotRequired[Literal["default", "extended"]] updated_at: NotRequired[Union[datetime, None]] schedule: NotRequired[Union[None, Literal["weekly"]]] diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0836.py b/githubkit/versions/ghec_v2022_11_28/types/group_0836.py index d6f1bb3d..32b3bea8 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0836.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0836.py @@ -368,8 +368,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsType(TypedD base: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0837.py b/githubkit/versions/ghec_v2022_11_28/types/group_0837.py index 1e630904..7928eed3 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0837.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0837.py @@ -366,8 +366,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsType(Typed base: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0838.py b/githubkit/versions/ghec_v2022_11_28/types/group_0838.py index 5265ff37..a107a6c1 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0838.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0838.py @@ -368,8 +368,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsType(TypedD base: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/githubkit/versions/v2022_11_28/models/group_0229.py b/githubkit/versions/v2022_11_28/models/group_0229.py index 03cea3fc..db0cf7ba 100644 --- a/githubkit/versions/v2022_11_28/models/group_0229.py +++ b/githubkit/versions/v2022_11_28/models/group_0229.py @@ -46,6 +46,13 @@ class CodeScanningDefaultSetup(GitHubModel): ] ] ] = Field(default=UNSET, description="Languages to be analyzed.") + runner_type: Missing[Union[None, Literal["standard", "labeled"]]] = Field( + default=UNSET, description="Runner type to be used." + ) + runner_label: Missing[Union[str, None]] = Field( + default=UNSET, + description="Runner label to be used if the runner type is labeled.", + ) query_suite: Missing[Literal["default", "extended"]] = Field( default=UNSET, description="CodeQL query suite to be used." ) diff --git a/githubkit/versions/v2022_11_28/models/group_0778.py b/githubkit/versions/v2022_11_28/models/group_0778.py index 36e7faf6..e60ed3d1 100644 --- a/githubkit/versions/v2022_11_28/models/group_0778.py +++ b/githubkit/versions/v2022_11_28/models/group_0778.py @@ -413,8 +413,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItems(GitHubMode head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/v2022_11_28/models/group_0779.py b/githubkit/versions/v2022_11_28/models/group_0779.py index 816732a1..05472d04 100644 --- a/githubkit/versions/v2022_11_28/models/group_0779.py +++ b/githubkit/versions/v2022_11_28/models/group_0779.py @@ -402,8 +402,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItems(GitHubMod head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/v2022_11_28/models/group_0780.py b/githubkit/versions/v2022_11_28/models/group_0780.py index 98c7ac20..9cdb595e 100644 --- a/githubkit/versions/v2022_11_28/models/group_0780.py +++ b/githubkit/versions/v2022_11_28/models/group_0780.py @@ -410,8 +410,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItems(GitHubMode head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHead = ( Field() ) - id: float = Field() - number: float = Field() + id: int = Field() + number: int = Field() url: str = Field() diff --git a/githubkit/versions/v2022_11_28/types/group_0229.py b/githubkit/versions/v2022_11_28/types/group_0229.py index 051633e0..6a3c39b9 100644 --- a/githubkit/versions/v2022_11_28/types/group_0229.py +++ b/githubkit/versions/v2022_11_28/types/group_0229.py @@ -38,6 +38,8 @@ class CodeScanningDefaultSetupType(TypedDict): ] ] ] + runner_type: NotRequired[Union[None, Literal["standard", "labeled"]]] + runner_label: NotRequired[Union[str, None]] query_suite: NotRequired[Literal["default", "extended"]] updated_at: NotRequired[Union[datetime, None]] schedule: NotRequired[Union[None, Literal["weekly"]]] diff --git a/githubkit/versions/v2022_11_28/types/group_0778.py b/githubkit/versions/v2022_11_28/types/group_0778.py index e43eb1ac..c597f1ef 100644 --- a/githubkit/versions/v2022_11_28/types/group_0778.py +++ b/githubkit/versions/v2022_11_28/types/group_0778.py @@ -368,8 +368,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsType(TypedD base: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/githubkit/versions/v2022_11_28/types/group_0779.py b/githubkit/versions/v2022_11_28/types/group_0779.py index 906b53bf..8156b29e 100644 --- a/githubkit/versions/v2022_11_28/types/group_0779.py +++ b/githubkit/versions/v2022_11_28/types/group_0779.py @@ -366,8 +366,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsType(Typed base: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/githubkit/versions/v2022_11_28/types/group_0780.py b/githubkit/versions/v2022_11_28/types/group_0780.py index 91f856a9..a07a2d02 100644 --- a/githubkit/versions/v2022_11_28/types/group_0780.py +++ b/githubkit/versions/v2022_11_28/types/group_0780.py @@ -368,8 +368,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsType(TypedD base: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropBaseType head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHeadType - id: float - number: float + id: int + number: int url: str diff --git a/pyproject.toml b/pyproject.toml index 57322762..b74f853a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -472,6 +472,15 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des "null", ] } +# webhook workflow run workflow-run-*.workflow_run.pull_requests.number and .id should be integers +# https://github.com/github/rest-api-description/issues/4408 +"/components/schemas/webhook-workflow-run-completed/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" } +"/components/schemas/webhook-workflow-run-completed/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" } +"/components/schemas/webhook-workflow-run-in-progress/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" } +"/components/schemas/webhook-workflow-run-in-progress/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" } +"/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" } +"/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" } + # webhook repository dispatch action can be any string "/webhooks/repository-dispatch-sample.collected/post" = { operationId = "repository-dispatch" } # "/components/schemas/webhook-repository-dispatch-sample/properties/action" = { enum = "" }