{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/github/v1/webhook-release-payload.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": true,
  "description": "Validates GitHub release event webhook payload.\n",
  "properties": {
    "action": {
      "description": "The action performed on the release.\nKnown values: published, unpublished, created, edited, deleted, prereleased, released.\nGitHub may add new action types; validation accepts any non-empty string.\n",
      "minLength": 1,
      "type": "string"
    },
    "installation": {
      "additionalProperties": true,
      "properties": {
        "id": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "release": {
      "additionalProperties": true,
      "properties": {
        "author": {
          "additionalProperties": true,
          "properties": {
            "login": {
              "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
              "type": "string"
            }
          },
          "required": [
            "login"
          ],
          "type": "object"
        },
        "draft": {
          "type": "boolean"
        },
        "id": {
          "minimum": 1,
          "type": "integer"
        },
        "name": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "string"
            }
          ]
        },
        "prerelease": {
          "type": "boolean"
        },
        "tag_name": {
          "minLength": 1,
          "type": "string"
        },
        "target_commitish": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "id",
        "tag_name",
        "target_commitish",
        "draft",
        "prerelease",
        "author"
      ],
      "type": "object"
    },
    "repository": {
      "additionalProperties": true,
      "properties": {
        "full_name": {
          "pattern": "^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$",
          "type": "string"
        },
        "name": {
          "pattern": "^[A-Za-z0-9._-]+$",
          "type": "string"
        },
        "owner": {
          "additionalProperties": true,
          "anyOf": [
            {
              "required": [
                "name"
              ]
            },
            {
              "required": [
                "login"
              ]
            }
          ],
          "properties": {
            "login": {
              "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
              "type": "string"
            },
            "name": {
              "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "required": [
        "name",
        "full_name",
        "owner"
      ],
      "type": "object"
    },
    "sender": {
      "additionalProperties": true,
      "properties": {
        "login": {
          "pattern": "^([a-zA-Z0-9-_%\\[\\]]*)$",
          "type": "string"
        }
      },
      "required": [
        "login"
      ],
      "type": "object"
    }
  },
  "required": [
    "action",
    "release",
    "repository",
    "sender"
  ],
  "title": "GitHub Release Webhook Payload",
  "type": "object"
}