{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.forgeling.io/schemas/events/run.ready.json",
  "title": "run.ready",
  "description": "The run's container is up and its repository is cloned.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "image_digest",
    "resources"
  ],
  "properties": {
    "image_digest": {
      "type": "string",
      "description": "The run image the run started on."
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "path",
          "default_branch",
          "branch",
          "head_sha",
          "branch_created",
          "repo_policy_check"
        ],
        "properties": {
          "type": {
            "const": "git_repository"
          },
          "path": {
            "type": "string",
            "description": "Where the repository is, relative to the run root."
          },
          "default_branch": {
            "type": "string"
          },
          "branch": {
            "type": "string",
            "description": "The branch the run works on."
          },
          "head_sha": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$",
            "description": "The head of that branch at clone time."
          },
          "branch_created": {
            "type": "boolean"
          },
          "repo_policy_check": {
            "enum": [
              "passed",
              "failed_allowed"
            ]
          }
        }
      }
    }
  }
}
