{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://docs.overwire.io/schemas/statuses.schema.json",
  "title": "External statuses and check runs",
  "description": "Pre-staged commit statuses and check runs that merge prediction consumes. (.overwire/statuses.yml)",
  "type": "object",
  "properties": {
    "statuses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "string",
            "minLength": 1
          },
          "sha": {
            "type": "string",
            "minLength": 1
          },
          "pr": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "id": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "context": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "error",
              "failure",
              "pending",
              "success"
            ]
          },
          "description": {
            "type": "string"
          },
          "targetUrl": {
            "type": "string",
            "minLength": 1
          },
          "createdAt": {
            "type": "string",
            "minLength": 1
          },
          "updatedAt": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "context",
          "state"
        ],
        "additionalProperties": false
      }
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "string",
            "minLength": 1
          },
          "sha": {
            "type": "string",
            "minLength": 1
          },
          "pr": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "id": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "waiting",
              "requested",
              "pending"
            ]
          },
          "conclusion": {
            "type": "string",
            "enum": [
              "success",
              "skipped",
              "neutral",
              "failure",
              "error",
              "pending",
              "cancelled",
              "timed_out",
              "action_required",
              "stale",
              "startup_failure"
            ]
          },
          "summary": {
            "type": "string"
          },
          "detailsUrl": {
            "type": "string",
            "minLength": 1
          },
          "startedAt": {
            "type": "string",
            "minLength": 1
          },
          "completedAt": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
