{
  "$id": "https://r3ply.com/schemas/v0.0.1/config/moderation/github.v0.0.1.json",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Github moderation",
  "description": "Specify how comments should be sent to GitHub for moderation.",
  "type": "object",
  "required": [
    "owner",
    "repo",
    "file_path_{}"
  ],
  "unevaluatedProperties": false,
  "allOf": [
    {
      "$ref": "https://r3ply.com/schemas/v0.0.1/config/moderation.v0.0.1.json#/definitions/options"
    }
  ],
  "properties": {
    "type": {
      "const": "github"
    },
    "owner": {
      "title": "Repo owner",
      "description": "This should be the user or org name.",
      "type": "string",
      "pattern": "^[\\S]+$",
      "maxLength": 1024,
      "examples": [
        "asimpletune",
        "r3ply"
      ]
    },
    "repo": {
      "title": "Repo name",
      "description": "Name of GitHub repository.",
      "type": "string",
      "pattern": "^[\\S]+$",
      "maxLength": 1024,
      "examples": [
        "yoursite"
      ]
    },
    "file_path_{}": {
      "title": "File path template (string)",
      "description": "Specifies the file path of the new comment.",
      "type": "string",
      "pattern": "^(?!\\s*/)[\\s\\S]*$",
      "maxLength": 1024,
      "examples": [
        "content/comments/{{ comment.id | slice(end=8) }}.md"
      ],
      "$comment": "Can never begin with a `/`."
    },
    "base_branch_{}": {
      "title": "Base branch template (string)",
      "description": "Specifies the base branch of the new comment, e.g. `main`.",
      "type": "string",
      "pattern": "^[\\s\\S]*$",
      "maxLength": 128,
      "default": "main"
    },
    "head_branch_{}": {
      "title": "Head branch template (string)",
      "description": "Specifies the head branch of the new comment, e.g. `comment-123`.",
      "type": "string",
      "pattern": "^[\\s\\S]*$",
      "maxLength": 256,
      "default": "comment-{{ comment.ts_rcvd }}-{{ comment.id[:8] }}.md",
      "examples": [
        "{{ comment.id[:8] }}-{{ comment.ts_rcvd }}"
      ]
    },
    "commit_msg_{}": {
      "title": "Commit message template (string)",
      "description": "Specifies the commit message of the new comment.",
      "type": "string",
      "pattern": "^[\\s\\S]*$",
      "maxLength": 2096,
      "default": "\"commit_msg_{}\" = \"\"\"Comment submitted:\n\n  - Sender: {{ author.pseudonym }}\n  - Timestamp: {{ comment.ts_rcvd }}\n  - Subject: {{ comment.subject.url }}\n\n> {{ comment.txt | split(pat=\"\r\n\") | join(sep=\"\n> \") }}\"\"\""
    },
    "&commit_msg_{}": {
      "title": "Commit message template (file)",
      "description": "Specifies a file that has the commit message of the new comment.",
      "type": "string",
      "format": "uri-reference"
    },
    "pr_title_{}": {
      "title": "PR title template (string)",
      "description": "Specifies the PR title of the new comment.",
      "type": "string",
      "pattern": "^[\\s\\S]*$",
      "maxLength": 1024,
      "default": "New comment ({{ comment.id[:8] }}) on {{ comment.subject.url }} by author `{{ author.pseudonym[:7] }}`"
    },
    "pr_body_{}": {
      "title": "PR body template (string)",
      "description": "Specifies the PR body of the new comment.",
      "type": "string",
      "pattern": "^[\\s\\S]*$",
      "maxLength": 2096,
      "default": ""
    },
    "&pr_body_{}": {
      "title": "PR body template (file)",
      "description": "Specifies a file containing the PR body of the new comment.",
      "type": "string",
      "format": "uri-reference",
      "$comment": "File reference."
    },
    "github_host": {
      "title": "Github host",
      "description": "Only useful for enterprise instances of GitHub.",
      "type": "string",
      "format": "hostname",
      "default": "github.com",
      "$comment": "You probable don't want to change this."
    }
  }
}