зеркало из https://github.com/github/docs.git
Update OpenAPI Descriptions (#18002)
* Update OpenAPI Descriptions * Add decorated OpenAPI schema files
This commit is contained in:
Родитель
381beca66b
Коммит
3a85702cd5
|
@ -52380,86 +52380,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"verb": "post",
|
||||
"requestPath": "/repos/{owner}/{repo}/environments/{environment_name}",
|
||||
"serverUrl": "https://api.github.com",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"descriptionHTML": ""
|
||||
},
|
||||
{
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"descriptionHTML": ""
|
||||
},
|
||||
{
|
||||
"name": "environment_name",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"description": "The name of the environment",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"descriptionHTML": "<p>The name of the environment</p>"
|
||||
}
|
||||
],
|
||||
"x-codeSamples": [
|
||||
{
|
||||
"lang": "Shell",
|
||||
"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",
|
||||
"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>"
|
||||
},
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"source": "await octokit.request('POST /repos/{owner}/{repo}/environments/{environment_name}', {\n owner: 'octocat',\n repo: 'hello-world',\n environment_name: 'environment_name'\n})",
|
||||
"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>"
|
||||
}
|
||||
],
|
||||
"summary": "Create an environment",
|
||||
"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.",
|
||||
"tags": [
|
||||
"repos"
|
||||
],
|
||||
"operationId": "repos/create-an-environment",
|
||||
"externalDocs": {
|
||||
"description": "API method documentation",
|
||||
"url": "https://docs.github.com/rest/reference/repos#create-an-environment"
|
||||
},
|
||||
"x-github": {
|
||||
"githubCloudOnly": false,
|
||||
"enabledForGitHubApps": true,
|
||||
"previews": [],
|
||||
"category": "repos",
|
||||
"subcategory": "environments"
|
||||
},
|
||||
"slug": "create-an-environment",
|
||||
"category": "repos",
|
||||
"categoryLabel": "Repos",
|
||||
"subcategory": "environments",
|
||||
"subcategoryLabel": "Environments",
|
||||
"notes": [],
|
||||
"bodyParameters": [],
|
||||
"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>",
|
||||
"responses": [
|
||||
{
|
||||
"httpStatusCode": "200",
|
||||
"httpStatusMessage": "OK",
|
||||
"description": "Default response",
|
||||
"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>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"verb": "put",
|
||||
"requestPath": "/repos/{owner}/{repo}/environments/{environment_name}",
|
||||
|
@ -52506,15 +52426,15 @@
|
|||
"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>"
|
||||
}
|
||||
],
|
||||
"summary": "Set protection rules for an environment",
|
||||
"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.",
|
||||
"summary": "Create or update an environment",
|
||||
"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.",
|
||||
"tags": [
|
||||
"repos"
|
||||
],
|
||||
"operationId": "repos/set-environment-protection-rules",
|
||||
"operationId": "repos/create-or-update-environment",
|
||||
"externalDocs": {
|
||||
"description": "API method documentation",
|
||||
"url": "https://docs.github.com/rest/reference/repos#set-protection-rules-for-an-environment"
|
||||
"url": "https://docs.github.com/rest/reference/repos#create-or-update-an-environment"
|
||||
},
|
||||
"requestBody": {
|
||||
"content": {
|
||||
|
@ -52534,7 +52454,7 @@
|
|||
},
|
||||
"reviewers": {
|
||||
"type": "array of objects",
|
||||
"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>",
|
||||
"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>",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -52567,7 +52487,7 @@
|
|||
"name": "reviewers",
|
||||
"in": "body",
|
||||
"rawType": "array",
|
||||
"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.",
|
||||
"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.",
|
||||
"childParamsGroups": [
|
||||
{
|
||||
"parentName": "reviewers",
|
||||
|
@ -52674,13 +52594,13 @@
|
|||
"category": "repos",
|
||||
"subcategory": "environments"
|
||||
},
|
||||
"slug": "set-protection-rules-for-an-environment",
|
||||
"slug": "create-or-update-an-environment",
|
||||
"category": "repos",
|
||||
"categoryLabel": "Repos",
|
||||
"subcategory": "environments",
|
||||
"subcategoryLabel": "Environments",
|
||||
"notes": [],
|
||||
"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>",
|
||||
"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>",
|
||||
"responses": [
|
||||
{
|
||||
"httpStatusCode": "200",
|
||||
|
@ -52691,7 +52611,7 @@
|
|||
{
|
||||
"httpStatusCode": "422",
|
||||
"httpStatusMessage": "Unprocessable Entity",
|
||||
"description": "Response when protected branches and custom branch policies in deployment branch policy are set to the same value"
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bodyParameters": [
|
||||
|
@ -52707,7 +52627,7 @@
|
|||
},
|
||||
{
|
||||
"type": "array of objects",
|
||||
"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>",
|
||||
"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>",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -52740,7 +52660,7 @@
|
|||
"name": "reviewers",
|
||||
"in": "body",
|
||||
"rawType": "array",
|
||||
"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.",
|
||||
"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.",
|
||||
"childParamsGroups": [
|
||||
{
|
||||
"parentName": "reviewers",
|
||||
|
|
|
@ -179933,450 +179933,16 @@
|
|||
"subcategory": "environments"
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create an environment",
|
||||
"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.",
|
||||
"tags": [
|
||||
"repos"
|
||||
],
|
||||
"operationId": "repos/create-an-environment",
|
||||
"externalDocs": {
|
||||
"description": "API method documentation",
|
||||
"url": "https://docs.github.com/rest/reference/repos#create-an-environment"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "environment_name",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"description": "The name of the environment",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"title": "Environment",
|
||||
"description": "Details of a deployment environment",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the environment.",
|
||||
"example": 56780428,
|
||||
"type": "integer"
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDExOkVudmlyb25tZW50NTY3ODA0Mjg="
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the environment.",
|
||||
"example": "staging",
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/repos/github/hello-world/environments/staging"
|
||||
},
|
||||
"html_url": {
|
||||
"type": "string",
|
||||
"example": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging"
|
||||
},
|
||||
"created_at": {
|
||||
"description": "The time that the environment was created, in ISO 8601 format.",
|
||||
"example": "2020-11-23T22:00:40Z",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"description": "The time that the environment was last updated, in ISO 8601 format.",
|
||||
"example": "2020-11-23T22:00:40Z",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"protection_rules": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"example": 3515
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDQ6R2F0ZTM1MTU="
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"example": "wait_timer"
|
||||
},
|
||||
"wait_timer": {
|
||||
"type": "integer",
|
||||
"example": 30,
|
||||
"description": "The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days)."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"node_id",
|
||||
"type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"example": 3755
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDQ6R2F0ZTM3NTU="
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"example": "required_reviewers"
|
||||
},
|
||||
"reviewers": {
|
||||
"type": "array",
|
||||
"description": "The people or teams that may approve 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.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The type of reviewer. Must be one of: `User` or `Team`",
|
||||
"enum": [
|
||||
"User",
|
||||
"Team"
|
||||
],
|
||||
"example": "User"
|
||||
},
|
||||
"reviewer": {
|
||||
"anyOf": [
|
||||
{
|
||||
"title": "Simple User",
|
||||
"description": "Simple User",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"login": {
|
||||
"type": "string",
|
||||
"example": "octocat"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"example": 1
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDQ6VXNlcjE="
|
||||
},
|
||||
"avatar_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://github.com/images/error/octocat_happy.gif"
|
||||
},
|
||||
"gravatar_id": {
|
||||
"type": "string",
|
||||
"example": "41d064eb2195891e12d0413f63227ea7",
|
||||
"nullable": true
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat"
|
||||
},
|
||||
"html_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://github.com/octocat"
|
||||
},
|
||||
"followers_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat/followers"
|
||||
},
|
||||
"following_url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/users/octocat/following{/other_user}"
|
||||
},
|
||||
"gists_url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
|
||||
},
|
||||
"starred_url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
|
||||
},
|
||||
"subscriptions_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat/subscriptions"
|
||||
},
|
||||
"organizations_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat/orgs"
|
||||
},
|
||||
"repos_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat/repos"
|
||||
},
|
||||
"events_url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/users/octocat/events{/privacy}"
|
||||
},
|
||||
"received_events_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/users/octocat/received_events"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"example": "User"
|
||||
},
|
||||
"site_admin": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"starred_at": {
|
||||
"type": "string",
|
||||
"example": "\"2020-07-09T00:17:55Z\""
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"avatar_url",
|
||||
"events_url",
|
||||
"followers_url",
|
||||
"following_url",
|
||||
"gists_url",
|
||||
"gravatar_id",
|
||||
"html_url",
|
||||
"id",
|
||||
"node_id",
|
||||
"login",
|
||||
"organizations_url",
|
||||
"received_events_url",
|
||||
"repos_url",
|
||||
"site_admin",
|
||||
"starred_url",
|
||||
"subscriptions_url",
|
||||
"type",
|
||||
"url"
|
||||
],
|
||||
"nullable": true
|
||||
},
|
||||
{
|
||||
"title": "Team Simple",
|
||||
"description": "Groups of organization members that gives permissions on specified repositories.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier of the team",
|
||||
"type": "integer",
|
||||
"example": 1
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDQ6VGVhbTE="
|
||||
},
|
||||
"url": {
|
||||
"description": "URL for the team",
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/organizations/1/team/1"
|
||||
},
|
||||
"members_url": {
|
||||
"type": "string",
|
||||
"example": "https://api.github.com/organizations/1/team/1/members{/member}"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name of the team",
|
||||
"type": "string",
|
||||
"example": "Justice League"
|
||||
},
|
||||
"description": {
|
||||
"description": "Description of the team",
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "A great team."
|
||||
},
|
||||
"permission": {
|
||||
"description": "Permission that the team will have for its repositories",
|
||||
"type": "string",
|
||||
"example": "admin"
|
||||
},
|
||||
"privacy": {
|
||||
"description": "The level of privacy this team should have",
|
||||
"type": "string",
|
||||
"example": "closed"
|
||||
},
|
||||
"html_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://github.com/orgs/rails/teams/core"
|
||||
},
|
||||
"repositories_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"example": "https://api.github.com/organizations/1/team/1/repos"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string",
|
||||
"example": "justice-league"
|
||||
},
|
||||
"ldap_dn": {
|
||||
"description": "Distinguished Name (DN) that team maps to within LDAP environment",
|
||||
"example": "uid=example,ou=users,dc=github,dc=com",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"node_id",
|
||||
"url",
|
||||
"members_url",
|
||||
"name",
|
||||
"description",
|
||||
"permission",
|
||||
"html_url",
|
||||
"repositories_url",
|
||||
"slug"
|
||||
],
|
||||
"nullable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"node_id",
|
||||
"type"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"example": 3515
|
||||
},
|
||||
"node_id": {
|
||||
"type": "string",
|
||||
"example": "MDQ6R2F0ZTM1MTU="
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"example": "branch_policy"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"node_id",
|
||||
"type"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"deployment_branch_policy": {
|
||||
"type": "object",
|
||||
"description": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.",
|
||||
"properties": {
|
||||
"protected_branches": {
|
||||
"type": "boolean",
|
||||
"description": "Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`."
|
||||
},
|
||||
"custom_branch_policies": {
|
||||
"type": "boolean",
|
||||
"description": "Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`."
|
||||
}
|
||||
},
|
||||
"nullable": true,
|
||||
"required": [
|
||||
"protected_branches",
|
||||
"custom_branch_policies"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"node_id",
|
||||
"name",
|
||||
"url",
|
||||
"html_url",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
]
|
||||
},
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 161088068,
|
||||
"node_id": "MDExOkVudmlyb25tZW50MTYxMDg4MDY4",
|
||||
"name": "staging",
|
||||
"url": "https://api.github.com/repos/github/hello-world/environments/staging",
|
||||
"html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging",
|
||||
"created_at": "2020-11-23T22:00:40Z",
|
||||
"updated_at": "2020-11-23T22:00:40Z",
|
||||
"protection_rules": [
|
||||
|
||||
],
|
||||
"deployment_branch_policy": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-github": {
|
||||
"githubCloudOnly": false,
|
||||
"enabledForGitHubApps": true,
|
||||
"previews": [
|
||||
|
||||
],
|
||||
"category": "repos",
|
||||
"subcategory": "environments"
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Set protection rules for an environment",
|
||||
"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.",
|
||||
"summary": "Create or update an environment",
|
||||
"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.",
|
||||
"tags": [
|
||||
"repos"
|
||||
],
|
||||
"operationId": "repos/set-environment-protection-rules",
|
||||
"operationId": "repos/create-or-update-environment",
|
||||
"externalDocs": {
|
||||
"description": "API method documentation",
|
||||
"url": "https://docs.github.com/rest/reference/repos#set-protection-rules-for-an-environment"
|
||||
"url": "https://docs.github.com/rest/reference/repos#create-or-update-an-environment"
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
|
@ -180418,7 +179984,7 @@
|
|||
},
|
||||
"reviewers": {
|
||||
"type": "array",
|
||||
"description": "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.",
|
||||
"description": "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.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -180908,7 +180474,7 @@
|
|||
}
|
||||
},
|
||||
"422": {
|
||||
"description": "Response when `protected_branches` and `custom_branch_policies` in `deployment_branch_policy` are set to the same value",
|
||||
"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",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче