-
Notifications
You must be signed in to change notification settings - Fork 292
Description
Schema Inaccuracy
The schema for a deployment protection rule webhook event is:
webhook-deployment-protection-rule-requested:
title: deployment protection rule requested event
type: object
properties:
action:
type: string
enum:
- requested
environment:
description: The name of the environment that has the deployment protection
rule.
type: string
event:
description: The event that triggered the deployment protection rule.
type: string
deployment_callback_url:
description: The URL to review the deployment protection rule.
type: string
format: uri
deployment:
"$ref": "#/components/schemas/deployment"
pull_requests:
type: array
items:
"$ref": "#/components/schemas/pull-request"
repository:
"$ref": "#/components/schemas/repository-webhooks"
organization:
"$ref": "#/components/schemas/organization-simple-webhooks"
installation:
"$ref": "#/components/schemas/simple-installation"
sender:
"$ref": "#/components/schemas/simple-user-webhooks"
(In the docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#deployment_protection_rule)
All of the fields here are optional. Is that correct? I suspect not.
For example: deployment_callback_url: what is the meaning of a deployment protection rule webhook event that doesn't include a callback URL, and what would one even do with such a thing? Same thing for deployment — how does a deployment protection rule fire on a null or missing deployment…?
(intallation, similarly.)
I've not seen either of those in the wild, either, which further makes me suspect they're actually always present. It'd be nice if the schema had that. (And then, I could just do a rote translation to T, instead of Optional<T> for those fields.)
Expected
Probably, some or all of these fields are required. It'd be great if the docs specified.