|
1 | 1 | {
|
2 | 2 | "openapi": "3.0.3",
|
3 | 3 | "info": {
|
4 |
| - "version": "2.4.2", |
| 4 | + "version": "2.5.0", |
5 | 5 | "title": "GitHub's official OpenAPI spec + Octokit extension",
|
6 | 6 | "description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
|
7 | 7 | "license": { "name": "MIT", "url": "https://spdx.org/licenses/MIT" },
|
|
16441 | 16441 | "x-octokit": {}
|
16442 | 16442 | }
|
16443 | 16443 | },
|
| 16444 | + "/repos/{owner}/{repo}/branches/{branch}/rename": { |
| 16445 | + "post": { |
| 16446 | + "summary": "Rename a branch", |
| 16447 | + "description": "Renames a branch in a repository.\n\n**Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see \"[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)\".\n\nThe permissions required to use this endpoint depends on whether you are renaming the default branch.\n\nTo rename a non-default branch:\n\n* Users must have push access.\n* GitHub Apps must have the `contents:write` repository permission.\n\nTo rename the default branch:\n\n* Users must have admin or owner permissions.\n* GitHub Apps must have the `administration:write` repository permission.", |
| 16448 | + "tags": ["repos"], |
| 16449 | + "operationId": "repos/rename-branch", |
| 16450 | + "externalDocs": { |
| 16451 | + "description": "API method documentation", |
| 16452 | + "url": "https://docs.github.com/rest/reference/repos#rename-a-branch" |
| 16453 | + }, |
| 16454 | + "parameters": [ |
| 16455 | + { "$ref": "#/components/parameters/owner" }, |
| 16456 | + { "$ref": "#/components/parameters/repo" }, |
| 16457 | + { "$ref": "#/components/parameters/branch" } |
| 16458 | + ], |
| 16459 | + "requestBody": { |
| 16460 | + "content": { |
| 16461 | + "application/json": { |
| 16462 | + "schema": { |
| 16463 | + "type": "object", |
| 16464 | + "properties": { |
| 16465 | + "new_name": { |
| 16466 | + "type": "string", |
| 16467 | + "description": "The new name of the branch." |
| 16468 | + } |
| 16469 | + }, |
| 16470 | + "required": ["new_name"] |
| 16471 | + }, |
| 16472 | + "example": { "new_name": "my_renamed_branch" } |
| 16473 | + } |
| 16474 | + } |
| 16475 | + }, |
| 16476 | + "responses": { |
| 16477 | + "201": { |
| 16478 | + "description": "response", |
| 16479 | + "content": { |
| 16480 | + "application/json": { |
| 16481 | + "schema": { |
| 16482 | + "$ref": "#/components/schemas/branch-with-protection" |
| 16483 | + }, |
| 16484 | + "examples": { |
| 16485 | + "default": { |
| 16486 | + "$ref": "#/components/examples/branch-with-protection" |
| 16487 | + } |
| 16488 | + } |
| 16489 | + } |
| 16490 | + } |
| 16491 | + }, |
| 16492 | + "403": { "$ref": "#/components/responses/forbidden" }, |
| 16493 | + "404": { "$ref": "#/components/responses/not_found" }, |
| 16494 | + "422": { "$ref": "#/components/responses/validation_failed" } |
| 16495 | + }, |
| 16496 | + "x-github": { |
| 16497 | + "githubCloudOnly": false, |
| 16498 | + "enabledForGitHubApps": true, |
| 16499 | + "previews": [], |
| 16500 | + "category": "repos", |
| 16501 | + "subcategory": "branches" |
| 16502 | + }, |
| 16503 | + "x-octokit": {} |
| 16504 | + } |
| 16505 | + }, |
16444 | 16506 | "/repos/{owner}/{repo}/check-runs": {
|
16445 | 16507 | "post": {
|
16446 | 16508 | "summary": "Create a check run",
|
|
67271 | 67333 | },
|
67272 | 67334 | "branch": {
|
67273 | 67335 | "name": "branch",
|
67274 |
| - "description": "branch+ parameter", |
| 67336 | + "description": "The name of the branch.", |
67275 | 67337 | "in": "path",
|
67276 | 67338 | "required": true,
|
67277 | 67339 | "schema": { "type": "string" },
|
|
0 commit comments