{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/pull-request-labeler.json",
  "$comment": "https://github.com/actions/labeler",
  "title": "Pull Request Labeler",
  "description": "A GitHub Action for automatically labelling pull requests.",
  "type": "object",
  "properties": {
    "changed-files-labels-limit": {
      "$ref": "#/definitions/nonNegativeInteger"
    },
    "max-files-changed": {
      "$ref": "#/definitions/nonNegativeInteger"
    }
  },
  "additionalProperties": {
    "$ref": "#/definitions/label"
  },
  "definitions": {
    "nonNegativeInteger": {
      "description": "A non-negative integer. Numeric strings are accepted by actions/labeler.",
      "oneOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*\\d+\\s*$"
        }
      ]
    },
    "stringOrStringArray": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "globRule": {
      "title": "Glob rule",
      "type": "object",
      "minProperties": 1,
      "properties": {
        "any-glob-to-any-file": {
          "$ref": "#/definitions/stringOrStringArray"
        },
        "any-glob-to-all-files": {
          "$ref": "#/definitions/stringOrStringArray"
        },
        "all-globs-to-any-file": {
          "$ref": "#/definitions/stringOrStringArray"
        },
        "all-globs-to-all-files": {
          "$ref": "#/definitions/stringOrStringArray"
        }
      },
      "additionalProperties": false
    },
    "match": {
      "title": "Match",
      "type": "object",
      "minProperties": 1,
      "properties": {
        "changed-files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/globRule"
          }
        },
        "base-branch": {
          "$ref": "#/definitions/stringOrStringArray"
        },
        "head-branch": {
          "$ref": "#/definitions/stringOrStringArray"
        }
      },
      "additionalProperties": false
    },
    "label": {
      "title": "Label",
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "all": {
                "title": "All",
                "type": "array",
                "items": {
                  "$ref": "#/definitions/match"
                }
              }
            },
            "additionalProperties": false,
            "required": ["all"]
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "title": "Any",
                "type": "array",
                "items": {
                  "$ref": "#/definitions/match"
                }
              }
            },
            "additionalProperties": false,
            "required": ["any"]
          },
          {
            "$ref": "#/definitions/match"
          }
        ]
      }
    }
  }
}
