dev.knotless.protectBranch

lexicons.knotless.dev

Documentation

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.

main procedure

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

Encodingapplication/json
branch string Required

The branch, without refs/heads/.

maxLength: 255 bytes
merges boolean Optional

Whether it takes merge commits; otherwise pulls merge into it squashed.

queue boolean Optional

Whether pulls land on it only through the merge queue.

repo stringat-uri Required

The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.

Output

Encodingapplication/json
rules array Required

The protected branches now.

Errors

NotFound No such repository.
AuthenticationRequired No account is logged in to the pages, or its session has ended.
Forbidden The account logged in is not the repository's owner.
Try It

Requests are sent directly from your browser. Some servers may block requests due to CORS.

Base URL for XRPC calls (e.g., https://bsky.social)
Enter valid JSON for the request body
View raw schema
{
  "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.",
  "errors": [
    {
      "description": "No such repository.",
      "name": "NotFound"
    },
    {
      "description": "No account is logged in to the pages, or its session has ended.",
      "name": "AuthenticationRequired"
    },
    {
      "description": "The account logged in is not the repository's owner.",
      "name": "Forbidden"
    }
  ],
  "input": {
    "encoding": "application/json",
    "schema": {
      "properties": {
        "branch": {
          "description": "The branch, without refs/heads/.",
          "maxLength": 255,
          "type": "string"
        },
        "merges": {
          "description": "Whether it takes merge commits; otherwise pulls merge into it squashed.",
          "type": "boolean"
        },
        "queue": {
          "description": "Whether pulls land on it only through the merge queue.",
          "type": "boolean"
        },
        "repo": {
          "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
          "format": "at-uri",
          "type": "string"
        },
        "reviews": {
          "description": "The reviews a pull needs before it merges into the branch. Absent, none.",
          "ref": "dev.knotless.repo#reviews",
          "type": "ref"
        }
      },
      "required": [
        "repo",
        "branch"
      ],
      "type": "object"
    }
  },
  "output": {
    "encoding": "application/json",
    "schema": {
      "properties": {
        "rules": {
          "description": "The protected branches now.",
          "items": {
            "ref": "dev.knotless.repo#rule",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "rules"
      ],
      "type": "object"
    }
  },
  "type": "procedure"
}

Lexicon Garden

@