Skip to content

Commit 1efd645

Browse files
committed
fix: add required properties for deployment_protection_rule.requested
See github/rest-api-description#3195
1 parent fb0d2b7 commit 1efd645

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"title": "deployment protection rule requested event",
3+
"type": "object",
4+
"properties": {
5+
"action": {
6+
"type": "string",
7+
"enum": ["requested"]
8+
},
9+
"environment": {
10+
"description": "The name of the environment that has the deployment protection rule.",
11+
"type": "string"
12+
},
13+
"event": {
14+
"description": "The event that triggered the deployment protection rule.",
15+
"type": "string"
16+
},
17+
"deployment_callback_url": {
18+
"description": "The URL to review the deployment protection rule.",
19+
"type": "string",
20+
"format": "uri"
21+
},
22+
"deployment": {
23+
"$ref": "#/components/schemas/deployment"
24+
},
25+
"pull_requests": {
26+
"type": "array",
27+
"items": {
28+
"$ref": "#/components/schemas/pull-request"
29+
}
30+
},
31+
"repository": {
32+
"$ref": "#/components/schemas/repository-webhooks"
33+
},
34+
"organization": {
35+
"$ref": "#/components/schemas/organization-simple-webhooks"
36+
},
37+
"installation": {
38+
"$ref": "#/components/schemas/simple-installation"
39+
},
40+
"sender": {
41+
"$ref": "#/components/schemas/simple-user-webhooks"
42+
}
43+
},
44+
"required": ["action", "repository", "sender"]
45+
}

scripts/overrides/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,13 @@ export default function overrides(file, schema) {
122122
"./milestone-opened-ghes.json",
123123
);
124124
}
125+
126+
if (!["3.8", "3.9"].includes(ghesVersion) || isDotcom || isAE || isGHEC) {
127+
// Missing the `required` property in the schema, which makes all properties optional
128+
replaceSchema(
129+
schema,
130+
"webhook-deployment-protection-rule-requested",
131+
"./deployment-protection-rule-requested.json",
132+
);
133+
}
125134
}

0 commit comments

Comments
 (0)