Skip to content

Commit efeb2c9

Browse files
committed
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.
1 parent cd24a9b commit efeb2c9

17 files changed

+51
-24
lines changed

Diff for: githubkit/versions/ghec_v2022_11_28/models/group_0266.py

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class CodeScanningDefaultSetup(GitHubModel):
4646
]
4747
]
4848
] = Field(default=UNSET, description="Languages to be analyzed.")
49+
runner_type: Missing[Union[None, Literal["standard", "labeled"]]] = Field(
50+
default=UNSET, description="Runner type to be used."
51+
)
52+
runner_label: Missing[Union[str, None]] = Field(
53+
default=UNSET,
54+
description="Runner label to be used if the runner type is labeled.",
55+
)
4956
query_suite: Missing[Literal["default", "extended"]] = Field(
5057
default=UNSET, description="CodeQL query suite to be used."
5158
)

Diff for: githubkit/versions/ghec_v2022_11_28/models/group_0836.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItems(GitHubMode
413413
head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHead = (
414414
Field()
415415
)
416-
id: float = Field()
417-
number: float = Field()
416+
id: int = Field()
417+
number: int = Field()
418418
url: str = Field()
419419

420420

Diff for: githubkit/versions/ghec_v2022_11_28/models/group_0837.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItems(GitHubMod
402402
head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHead = (
403403
Field()
404404
)
405-
id: float = Field()
406-
number: float = Field()
405+
id: int = Field()
406+
number: int = Field()
407407
url: str = Field()
408408

409409

Diff for: githubkit/versions/ghec_v2022_11_28/models/group_0838.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItems(GitHubMode
410410
head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHead = (
411411
Field()
412412
)
413-
id: float = Field()
414-
number: float = Field()
413+
id: int = Field()
414+
number: int = Field()
415415
url: str = Field()
416416

417417

Diff for: githubkit/versions/ghec_v2022_11_28/types/group_0266.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class CodeScanningDefaultSetupType(TypedDict):
3838
]
3939
]
4040
]
41+
runner_type: NotRequired[Union[None, Literal["standard", "labeled"]]]
42+
runner_label: NotRequired[Union[str, None]]
4143
query_suite: NotRequired[Literal["default", "extended"]]
4244
updated_at: NotRequired[Union[datetime, None]]
4345
schedule: NotRequired[Union[None, Literal["weekly"]]]

Diff for: githubkit/versions/ghec_v2022_11_28/types/group_0836.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsType(TypedD
368368

369369
base: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropBaseType
370370
head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHeadType
371-
id: float
372-
number: float
371+
id: int
372+
number: int
373373
url: str
374374

375375

Diff for: githubkit/versions/ghec_v2022_11_28/types/group_0837.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsType(Typed
366366

367367
base: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropBaseType
368368
head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHeadType
369-
id: float
370-
number: float
369+
id: int
370+
number: int
371371
url: str
372372

373373

Diff for: githubkit/versions/ghec_v2022_11_28/types/group_0838.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsType(TypedD
368368

369369
base: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropBaseType
370370
head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHeadType
371-
id: float
372-
number: float
371+
id: int
372+
number: int
373373
url: str
374374

375375

Diff for: githubkit/versions/v2022_11_28/models/group_0229.py

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class CodeScanningDefaultSetup(GitHubModel):
4646
]
4747
]
4848
] = Field(default=UNSET, description="Languages to be analyzed.")
49+
runner_type: Missing[Union[None, Literal["standard", "labeled"]]] = Field(
50+
default=UNSET, description="Runner type to be used."
51+
)
52+
runner_label: Missing[Union[str, None]] = Field(
53+
default=UNSET,
54+
description="Runner label to be used if the runner type is labeled.",
55+
)
4956
query_suite: Missing[Literal["default", "extended"]] = Field(
5057
default=UNSET, description="CodeQL query suite to be used."
5158
)

Diff for: githubkit/versions/v2022_11_28/models/group_0778.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItems(GitHubMode
413413
head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHead = (
414414
Field()
415415
)
416-
id: float = Field()
417-
number: float = Field()
416+
id: int = Field()
417+
number: int = Field()
418418
url: str = Field()
419419

420420

Diff for: githubkit/versions/v2022_11_28/models/group_0779.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItems(GitHubMod
402402
head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHead = (
403403
Field()
404404
)
405-
id: float = Field()
406-
number: float = Field()
405+
id: int = Field()
406+
number: int = Field()
407407
url: str = Field()
408408

409409

Diff for: githubkit/versions/v2022_11_28/models/group_0780.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItems(GitHubMode
410410
head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHead = (
411411
Field()
412412
)
413-
id: float = Field()
414-
number: float = Field()
413+
id: int = Field()
414+
number: int = Field()
415415
url: str = Field()
416416

417417

Diff for: githubkit/versions/v2022_11_28/types/group_0229.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class CodeScanningDefaultSetupType(TypedDict):
3838
]
3939
]
4040
]
41+
runner_type: NotRequired[Union[None, Literal["standard", "labeled"]]]
42+
runner_label: NotRequired[Union[str, None]]
4143
query_suite: NotRequired[Literal["default", "extended"]]
4244
updated_at: NotRequired[Union[datetime, None]]
4345
schedule: NotRequired[Union[None, Literal["weekly"]]]

Diff for: githubkit/versions/v2022_11_28/types/group_0778.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ class WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsType(TypedD
368368

369369
base: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropBaseType
370370
head: WebhookWorkflowRunCompletedPropWorkflowRunPropPullRequestsItemsPropHeadType
371-
id: float
372-
number: float
371+
id: int
372+
number: int
373373
url: str
374374

375375

Diff for: githubkit/versions/v2022_11_28/types/group_0779.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ class WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsType(Typed
366366

367367
base: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropBaseType
368368
head: WebhookWorkflowRunInProgressPropWorkflowRunPropPullRequestsItemsPropHeadType
369-
id: float
370-
number: float
369+
id: int
370+
number: int
371371
url: str
372372

373373

Diff for: githubkit/versions/v2022_11_28/types/group_0780.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ class WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsType(TypedD
368368

369369
base: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropBaseType
370370
head: WebhookWorkflowRunRequestedPropWorkflowRunPropPullRequestsItemsPropHeadType
371-
id: float
372-
number: float
371+
id: int
372+
number: int
373373
url: str
374374

375375

Diff for: pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,15 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des
472472
"null",
473473
] }
474474

475+
# webhook workflow run workflow-run-*.workflow_run.pull_requests.number and .id should be integers
476+
# https://github.com/github/rest-api-description/issues/4408
477+
"/components/schemas/webhook-workflow-run-completed/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" }
478+
"/components/schemas/webhook-workflow-run-completed/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" }
479+
"/components/schemas/webhook-workflow-run-in-progress/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" }
480+
"/components/schemas/webhook-workflow-run-in-progress/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" }
481+
"/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/id" = { type = "integer" }
482+
"/components/schemas/webhook-workflow-run-requested/properties/workflow_run/properties/pull_requests/items/properties/number" = { type = "integer" }
483+
475484
# webhook repository dispatch action can be any string
476485
"/webhooks/repository-dispatch-sample.collected/post" = { operationId = "repository-dispatch" }
477486
# "/components/schemas/webhook-repository-dispatch-sample/properties/action" = { enum = "<unset>" }

0 commit comments

Comments
 (0)