~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

7
79 lines · 2.7 KB Raw History
{
  "lexicon": 1,
  "id": "dev.knotless.protectBranch",
  "description": "Protects a branch of a repository.",
  "defs": {
    "main": {
      "type": "procedure",
      "description": "Adds the branch to the protected branches of the repository's dev.knotless.repo record, in place of any rule it had, as `knotless protect` does: through the gateway it then only moves forward, is never deleted, and unless merges is set takes no merge commits; with queue, pulls land on it only through the merge queue; with reviews, a pull merges into it only once reviewed as they ask. Only its owner, logged in to this appview's web pages, can: the appview writes with the session it keeps for that account, which the pages' session cookie names.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "repo",
            "branch"
          ],
          "properties": {
            "repo": {
              "type": "string",
              "format": "at-uri",
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it."
            },
            "branch": {
              "type": "string",
              "maxLength": 255,
              "description": "The branch, without refs/heads/."
            },
            "merges": {
              "type": "boolean",
              "description": "Whether it takes merge commits; otherwise pulls merge into it squashed."
            },
            "queue": {
              "type": "boolean",
              "description": "Whether pulls land on it only through the merge queue."
            },
            "reviews": {
              "type": "ref",
              "ref": "dev.knotless.repo#reviews",
              "description": "The reviews a pull needs before it merges into the branch. Absent, none."
            }
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "rules"
          ],
          "properties": {
            "rules": {
              "type": "array",
              "description": "The protected branches now.",
              "items": {
                "type": "ref",
                "ref": "dev.knotless.repo#rule"
              }
            }
          }
        }
      },
      "errors": [
        {
          "name": "NotFound",
          "description": "No such repository."
        },
        {
          "name": "AuthenticationRequired",
          "description": "No account is logged in to the pages, or its session has ended."
        },
        {
          "name": "Forbidden",
          "description": "The account logged in is not the repository's owner."
        }
      ]
    }
  }
}