|
52380 | 52380 | } |
52381 | 52381 | ] |
52382 | 52382 | }, |
52383 | | - { |
52384 | | - "verb": "post", |
52385 | | - "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", |
52386 | | - "serverUrl": "https://api.github.com", |
52387 | | - "parameters": [ |
52388 | | - { |
52389 | | - "name": "owner", |
52390 | | - "in": "path", |
52391 | | - "required": true, |
52392 | | - "schema": { |
52393 | | - "type": "string" |
52394 | | - }, |
52395 | | - "descriptionHTML": "" |
52396 | | - }, |
52397 | | - { |
52398 | | - "name": "repo", |
52399 | | - "in": "path", |
52400 | | - "required": true, |
52401 | | - "schema": { |
52402 | | - "type": "string" |
52403 | | - }, |
52404 | | - "descriptionHTML": "" |
52405 | | - }, |
52406 | | - { |
52407 | | - "name": "environment_name", |
52408 | | - "in": "path", |
52409 | | - "required": true, |
52410 | | - "description": "The name of the environment", |
52411 | | - "schema": { |
52412 | | - "type": "string" |
52413 | | - }, |
52414 | | - "descriptionHTML": "<p>The name of the environment</p>" |
52415 | | - } |
52416 | | - ], |
52417 | | - "x-codeSamples": [ |
52418 | | - { |
52419 | | - "lang": "Shell", |
52420 | | - "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME", |
52421 | | - "html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/repos/octocat/hello-world/environments/ENVIRONMENT_NAME</code></pre>" |
52422 | | - }, |
52423 | | - { |
52424 | | - "lang": "JavaScript", |
52425 | | - "source": "await octokit.request('POST /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})", |
52426 | | - "html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'POST /repos/{owner}/{repo}/environments/{environment_name}'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">environment_name</span>: <span class=\"hljs-string\">'environment_name'</span>\n})\n</code></pre>" |
52427 | | - } |
52428 | | - ], |
52429 | | - "summary": "Create an environment", |
52430 | | - "description": "Create an environment for a repository. If an environment with the specified name already exists, the existing environment will be returned.\n\nThe created environment will not have any protection rules configured. To configure protection rules for the created environment, see \"[Set protection rules for an environment](#set-protection-rules-for-an-environment)\".\n\nYou must authenticate using an access token with the repo scope to use this endpoint.", |
52431 | | - "tags": [ |
52432 | | - "repos" |
52433 | | - ], |
52434 | | - "operationId": "repos/create-an-environment", |
52435 | | - "externalDocs": { |
52436 | | - "description": "API method documentation", |
52437 | | - "url": "https://docs.github.com/rest/reference/repos#create-an-environment" |
52438 | | - }, |
52439 | | - "x-github": { |
52440 | | - "githubCloudOnly": false, |
52441 | | - "enabledForGitHubApps": true, |
52442 | | - "previews": [], |
52443 | | - "category": "repos", |
52444 | | - "subcategory": "environments" |
52445 | | - }, |
52446 | | - "slug": "create-an-environment", |
52447 | | - "category": "repos", |
52448 | | - "categoryLabel": "Repos", |
52449 | | - "subcategory": "environments", |
52450 | | - "subcategoryLabel": "Environments", |
52451 | | - "notes": [], |
52452 | | - "bodyParameters": [], |
52453 | | - "descriptionHTML": "<p>Create an environment for a repository. If an environment with the specified name already exists, the existing environment will be returned.</p>\n<p>The created environment will not have any protection rules configured. To configure protection rules for the created environment, see \"<a href=\"#set-protection-rules-for-an-environment\">Set protection rules for an environment</a>\".</p>\n<p>You must authenticate using an access token with the repo scope to use this endpoint.</p>", |
52454 | | - "responses": [ |
52455 | | - { |
52456 | | - "httpStatusCode": "200", |
52457 | | - "httpStatusMessage": "OK", |
52458 | | - "description": "Default response", |
52459 | | - "payload": "<pre><code class=\"hljs language-json\">{\n <span class=\"hljs-attr\">\"id\"</span>: <span class=\"hljs-number\">161088068</span>,\n <span class=\"hljs-attr\">\"node_id\"</span>: <span class=\"hljs-string\">\"MDExOkVudmlyb25tZW50MTYxMDg4MDY4\"</span>,\n <span class=\"hljs-attr\">\"name\"</span>: <span class=\"hljs-string\">\"staging\"</span>,\n <span class=\"hljs-attr\">\"url\"</span>: <span class=\"hljs-string\">\"https://api.github.com/repos/github/hello-world/environments/staging\"</span>,\n <span class=\"hljs-attr\">\"html_url\"</span>: <span class=\"hljs-string\">\"https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging\"</span>,\n <span class=\"hljs-attr\">\"created_at\"</span>: <span class=\"hljs-string\">\"2020-11-23T22:00:40Z\"</span>,\n <span class=\"hljs-attr\">\"updated_at\"</span>: <span class=\"hljs-string\">\"2020-11-23T22:00:40Z\"</span>,\n <span class=\"hljs-attr\">\"protection_rules\"</span>: [],\n <span class=\"hljs-attr\">\"deployment_branch_policy\"</span>: <span class=\"hljs-literal\">null</span>\n}\n</code></pre>" |
52460 | | - } |
52461 | | - ] |
52462 | | - }, |
52463 | 52383 | { |
52464 | 52384 | "verb": "put", |
52465 | 52385 | "requestPath": "/repos/{owner}/{repo}/environments/{environment_name}", |
@@ -52506,15 +52426,15 @@ |
52506 | 52426 | "html": "<pre><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">await</span> octokit.request(<span class=\"hljs-string\">'PUT /repos/{owner}/{repo}/environments/{environment_name}'</span>, {\n <span class=\"hljs-attr\">owner</span>: <span class=\"hljs-string\">'octocat'</span>,\n <span class=\"hljs-attr\">repo</span>: <span class=\"hljs-string\">'hello-world'</span>,\n <span class=\"hljs-attr\">environment_name</span>: <span class=\"hljs-string\">'environment_name'</span>,\n <span class=\"hljs-attr\">wait_timer</span>: <span class=\"hljs-number\">42</span>\n})\n</code></pre>" |
52507 | 52427 | } |
52508 | 52428 | ], |
52509 | | - "summary": "Set protection rules for an environment", |
52510 | | - "description": "Set protection rules, such as required reviewers, for an environment. For more information about environment protection rules, see \"[Environments](/actions/reference/environments#environment-protection-rules).\"\n\n**Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"[Environments](/actions/reference/environments#deployment-branches).\"\n\nYou must authenticate using an access token with the repo scope to use this endpoint.", |
| 52429 | + "summary": "Create or update an environment", |
| 52430 | + "description": "Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"[Environments](/actions/reference/environments#environment-protection-rules).\"\n\n**Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"[Environments](/actions/reference/environments#deployment-branches).\"\n\n**Note:** To create or update secrets for an environment, see \"[Secrets](/rest/reference/actions#secrets).\"\n\nYou must authenticate using an access token with the repo scope to use this endpoint.", |
52511 | 52431 | "tags": [ |
52512 | 52432 | "repos" |
52513 | 52433 | ], |
52514 | | - "operationId": "repos/set-environment-protection-rules", |
| 52434 | + "operationId": "repos/create-or-update-environment", |
52515 | 52435 | "externalDocs": { |
52516 | 52436 | "description": "API method documentation", |
52517 | | - "url": "https://docs.github.com/rest/reference/repos#set-protection-rules-for-an-environment" |
| 52437 | + "url": "https://docs.github.com/rest/reference/repos#create-or-update-an-environment" |
52518 | 52438 | }, |
52519 | 52439 | "requestBody": { |
52520 | 52440 | "content": { |
|
52534 | 52454 | }, |
52535 | 52455 | "reviewers": { |
52536 | 52456 | "type": "array of objects", |
52537 | | - "description": "<p>The people or teams that may jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.</p>", |
| 52457 | + "description": "<p>The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.</p>", |
52538 | 52458 | "items": { |
52539 | 52459 | "type": "object", |
52540 | 52460 | "properties": { |
|
52567 | 52487 | "name": "reviewers", |
52568 | 52488 | "in": "body", |
52569 | 52489 | "rawType": "array", |
52570 | | - "rawDescription": "The people or teams that may jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", |
| 52490 | + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", |
52571 | 52491 | "childParamsGroups": [ |
52572 | 52492 | { |
52573 | 52493 | "parentName": "reviewers", |
@@ -52674,13 +52594,13 @@ |
52674 | 52594 | "category": "repos", |
52675 | 52595 | "subcategory": "environments" |
52676 | 52596 | }, |
52677 | | - "slug": "set-protection-rules-for-an-environment", |
| 52597 | + "slug": "create-or-update-an-environment", |
52678 | 52598 | "category": "repos", |
52679 | 52599 | "categoryLabel": "Repos", |
52680 | 52600 | "subcategory": "environments", |
52681 | 52601 | "subcategoryLabel": "Environments", |
52682 | 52602 | "notes": [], |
52683 | | - "descriptionHTML": "<p>Set protection rules, such as required reviewers, for an environment. For more information about environment protection rules, see \"<a href=\"/actions/reference/environments#environment-protection-rules\">Environments</a>.\"</p>\n<p><strong>Note:</strong> Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"<a href=\"/actions/reference/environments#deployment-branches\">Environments</a>.\"</p>\n<p>You must authenticate using an access token with the repo scope to use this endpoint.</p>", |
| 52603 | + "descriptionHTML": "<p>Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see \"<a href=\"/actions/reference/environments#environment-protection-rules\">Environments</a>.\"</p>\n<p><strong>Note:</strong> Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see \"<a href=\"/actions/reference/environments#deployment-branches\">Environments</a>.\"</p>\n<p><strong>Note:</strong> To create or update secrets for an environment, see \"<a href=\"/rest/reference/actions#secrets\">Secrets</a>.\"</p>\n<p>You must authenticate using an access token with the repo scope to use this endpoint.</p>", |
52684 | 52604 | "responses": [ |
52685 | 52605 | { |
52686 | 52606 | "httpStatusCode": "200", |
|
52691 | 52611 | { |
52692 | 52612 | "httpStatusCode": "422", |
52693 | 52613 | "httpStatusMessage": "Unprocessable Entity", |
52694 | | - "description": "Response when protected branches and custom branch policies in deployment branch policy are set to the same value" |
| 52614 | + "description": "Validation error when the environment name is invalid or when protected branches and custom branch policies in deployment branch policy are set to the same value" |
52695 | 52615 | } |
52696 | 52616 | ], |
52697 | 52617 | "bodyParameters": [ |
|
52707 | 52627 | }, |
52708 | 52628 | { |
52709 | 52629 | "type": "array of objects", |
52710 | | - "description": "<p>The people or teams that may jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.</p>", |
| 52630 | + "description": "<p>The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.</p>", |
52711 | 52631 | "items": { |
52712 | 52632 | "type": "object", |
52713 | 52633 | "properties": { |
|
52740 | 52660 | "name": "reviewers", |
52741 | 52661 | "in": "body", |
52742 | 52662 | "rawType": "array", |
52743 | | - "rawDescription": "The people or teams that may jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", |
| 52663 | + "rawDescription": "The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.", |
52744 | 52664 | "childParamsGroups": [ |
52745 | 52665 | { |
52746 | 52666 | "parentName": "reviewers", |
|
0 commit comments