diff --git a/docs/apps/scopeToken.md b/docs/apps/scopeToken.md
index 3e615dbc1..e1e9c3a14 100644
--- a/docs/apps/scopeToken.md
+++ b/docs/apps/scopeToken.md
@@ -49,12 +49,12 @@ The ID of the user or organization to scope the user-to-server access token to.
| reviewers[].type | no |
@@ -84,4 +86,4 @@ Whether only branches that match the specified name patterns can deploy to this
-See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/repos#set-protection-rules-for-an-environment).
+See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/repos#create-or-update-an-environment).
diff --git a/package-lock.json b/package-lock.json
index 599b0bd61..bda4fe2ea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1737,9 +1737,9 @@
}
},
"@octokit/openapi-types": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-5.2.0.tgz",
- "integrity": "sha512-MInMij2VK5o96Ei6qaHjxBglSZWOXQs9dTZfnGX2Xnr2mhA+yk9L/QCH4RcJGISJJCBclLHuY3ytq+iRgDfX7w=="
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-5.2.1.tgz",
+ "integrity": "sha512-Bf7MBvQ1nMpv15ANaQtRBsC7YnwQFPM0eUztp3luQs9L6sBEiQ6ArM1Wx5CG+N7tXETtd0oE0DMcU4wbLlCZIw=="
},
"@octokit/plugin-paginate-rest": {
"version": "2.10.0",
@@ -1806,11 +1806,11 @@
}
},
"@octokit/types": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.11.0.tgz",
- "integrity": "sha512-RMLAmpPZf/a33EsclBazKg02NCCj4rC69V9sUgf0SuWTjmnBD2QC1nIVtJo7RJrGnwG1+aoFBb2yTrWm/8AS7w==",
+ "version": "6.11.1",
+ "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.11.1.tgz",
+ "integrity": "sha512-UiSRTG2lrFbMUMwhKNR0uSV33Fzv4bNu1n5iFuuNOg80XCh0VYNhR4TQWgrkLhVxdDuej6s61aP3eQvVm6K6uA==",
"requires": {
- "@octokit/openapi-types": "^5.2.0"
+ "@octokit/openapi-types": "^5.2.1"
}
},
"@pika/babel-plugin-esm-import-rewrite": {
diff --git a/package.json b/package.json
index feb341337..7df32c466 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
- "@octokit/types": "^6.11.0",
+ "@octokit/types": "^6.11.1",
"deprecation": "^2.3.1"
},
"devDependencies": {
diff --git a/scripts/update-endpoints/generated/endpoints.json b/scripts/update-endpoints/generated/endpoints.json
index 80053e351..2e4fae2ca 100644
--- a/scripts/update-endpoints/generated/endpoints.json
+++ b/scripts/update-endpoints/generated/endpoints.json
@@ -8873,7 +8873,7 @@
},
{
"name": "repositories",
- "description": "The list of repository IDs to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified.",
+ "description": "The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified.",
"in": "BODY",
"type": "string[]",
"required": false,
@@ -8886,7 +8886,7 @@
},
{
"name": "repository_ids",
- "description": "The list of repository names to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified.",
+ "description": "The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified.",
"in": "BODY",
"type": "integer[]",
"required": false,
@@ -33705,72 +33705,6 @@
],
"renamed": null
},
- {
- "name": "Create an environment",
- "scope": "repos",
- "id": "createAnEnvironment",
- "method": "POST",
- "url": "/repos/{owner}/{repo}/environments/{environment_name}",
- "isDeprecated": false,
- "deprecationDate": null,
- "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.",
- "documentationUrl": "https://docs.github.com/rest/reference/repos#create-an-environment",
- "previews": [],
- "headers": [],
- "parameters": [
- {
- "name": "owner",
- "description": "",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "repo",
- "description": "",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "environment_name",
- "description": "The name of the environment",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- }
- ],
- "responses": [
- {
- "code": 200,
- "description": "response",
- "examples": [
- {
- "data": "{\"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}"
- }
- ]
- }
- ],
- "renamed": null
- },
{
"name": "Create a commit comment",
"scope": "repos",
@@ -35221,6 +35155,168 @@
],
"renamed": null
},
+ {
+ "name": "Create or update an environment",
+ "scope": "repos",
+ "id": "createOrUpdateEnvironment",
+ "method": "PUT",
+ "url": "/repos/{owner}/{repo}/environments/{environment_name}",
+ "isDeprecated": false,
+ "deprecationDate": null,
+ "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.",
+ "documentationUrl": "https://docs.github.com/rest/reference/repos#create-or-update-an-environment",
+ "previews": [],
+ "headers": [],
+ "parameters": [
+ {
+ "name": "owner",
+ "description": "",
+ "in": "PATH",
+ "type": "string",
+ "required": true,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "repo",
+ "description": "",
+ "in": "PATH",
+ "type": "string",
+ "required": true,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "environment_name",
+ "description": "The name of the environment",
+ "in": "PATH",
+ "type": "string",
+ "required": true,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "wait_timer",
+ "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).",
+ "in": "BODY",
+ "type": "integer",
+ "required": false,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "reviewers",
+ "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.",
+ "in": "BODY",
+ "type": "object[]",
+ "required": false,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "reviewers[].type",
+ "description": "The type of reviewer. Must be one of: `User` or `Team`",
+ "in": "BODY",
+ "type": "string",
+ "required": false,
+ "enum": ["User", "Team"],
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "reviewers[].id",
+ "description": "The id of the user or team who can review the deployment",
+ "in": "BODY",
+ "type": "integer",
+ "required": false,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "deployment_branch_policy",
+ "description": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.",
+ "in": "BODY",
+ "type": "object",
+ "required": false,
+ "enum": null,
+ "allowNull": true,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "deployment_branch_policy.protected_branches",
+ "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`.",
+ "in": "BODY",
+ "type": "boolean",
+ "required": true,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ },
+ {
+ "name": "deployment_branch_policy.custom_branch_policies",
+ "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`.",
+ "in": "BODY",
+ "type": "boolean",
+ "required": true,
+ "enum": null,
+ "allowNull": false,
+ "mapToData": null,
+ "validation": null,
+ "alias": null,
+ "deprecated": null
+ }
+ ],
+ "responses": [
+ {
+ "code": 200,
+ "description": "response",
+ "examples": [
+ {
+ "data": "{\"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\":[{\"id\":3736,\"node_id\":\"MDQ6R2F0ZTM3MzY=\",\"type\":\"wait_timer\",\"wait_timer\":30},{\"id\":3755,\"node_id\":\"MDQ6R2F0ZTM3NTU=\",\"type\":\"required_reviewers\",\"reviewers\":[{\"type\":\"User\",\"reviewer\":{\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false}},{\"type\":\"Team\",\"reviewer\":{\"id\":1,\"node_id\":\"MDQ6VGVhbTE=\",\"url\":\"https://api.github.com/teams/1\",\"html_url\":\"https://github.com/orgs/github/teams/justice-league\",\"name\":\"Justice League\",\"slug\":\"justice-league\",\"description\":\"A great team.\",\"privacy\":\"closed\",\"permission\":\"admin\",\"members_url\":\"https://api.github.com/teams/1/members{/member}\",\"repositories_url\":\"https://api.github.com/teams/1/repos\"}}]},{\"id\":3756,\"node_id\":\"MDQ6R2F0ZTM3NTY=\",\"type\":\"branch_policy\"}],\"deployment_branch_policy\":{\"protected_branches\":false,\"custom_branch_policies\":true}}"
+ }
+ ]
+ },
+ {
+ "code": 422,
+ "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",
+ "examples": null
+ }
+ ],
+ "renamed": null
+ },
{
"name": "Create or update file contents",
"scope": "repos",
@@ -43523,168 +43619,6 @@
],
"renamed": null
},
- {
- "name": "Set protection rules for an environment",
- "scope": "repos",
- "id": "setEnvironmentProtectionRules",
- "method": "PUT",
- "url": "/repos/{owner}/{repo}/environments/{environment_name}",
- "isDeprecated": false,
- "deprecationDate": null,
- "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.",
- "documentationUrl": "https://docs.github.com/rest/reference/repos#set-protection-rules-for-an-environment",
- "previews": [],
- "headers": [],
- "parameters": [
- {
- "name": "owner",
- "description": "",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "repo",
- "description": "",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "environment_name",
- "description": "The name of the environment",
- "in": "PATH",
- "type": "string",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "wait_timer",
- "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).",
- "in": "BODY",
- "type": "integer",
- "required": false,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "reviewers",
- "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.",
- "in": "BODY",
- "type": "object[]",
- "required": false,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "reviewers[].type",
- "description": "The type of reviewer. Must be one of: `User` or `Team`",
- "in": "BODY",
- "type": "string",
- "required": false,
- "enum": ["User", "Team"],
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "reviewers[].id",
- "description": "The id of the user or team who can review the deployment",
- "in": "BODY",
- "type": "integer",
- "required": false,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "deployment_branch_policy",
- "description": "The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.",
- "in": "BODY",
- "type": "object",
- "required": false,
- "enum": null,
- "allowNull": true,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "deployment_branch_policy.protected_branches",
- "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`.",
- "in": "BODY",
- "type": "boolean",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- },
- {
- "name": "deployment_branch_policy.custom_branch_policies",
- "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`.",
- "in": "BODY",
- "type": "boolean",
- "required": true,
- "enum": null,
- "allowNull": false,
- "mapToData": null,
- "validation": null,
- "alias": null,
- "deprecated": null
- }
- ],
- "responses": [
- {
- "code": 200,
- "description": "response",
- "examples": [
- {
- "data": "{\"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\":[{\"id\":3736,\"node_id\":\"MDQ6R2F0ZTM3MzY=\",\"type\":\"wait_timer\",\"wait_timer\":30},{\"id\":3755,\"node_id\":\"MDQ6R2F0ZTM3NTU=\",\"type\":\"required_reviewers\",\"reviewers\":[{\"type\":\"User\",\"reviewer\":{\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false}},{\"type\":\"Team\",\"reviewer\":{\"id\":1,\"node_id\":\"MDQ6VGVhbTE=\",\"url\":\"https://api.github.com/teams/1\",\"html_url\":\"https://github.com/orgs/github/teams/justice-league\",\"name\":\"Justice League\",\"slug\":\"justice-league\",\"description\":\"A great team.\",\"privacy\":\"closed\",\"permission\":\"admin\",\"members_url\":\"https://api.github.com/teams/1/members{/member}\",\"repositories_url\":\"https://api.github.com/teams/1/repos\"}}]},{\"id\":3756,\"node_id\":\"MDQ6R2F0ZTM3NTY=\",\"type\":\"branch_policy\"}],\"deployment_branch_policy\":{\"protected_branches\":false,\"custom_branch_policies\":true}}"
- }
- ]
- },
- {
- "code": 422,
- "description": "Response when `protected_branches` and `custom_branch_policies` in `deployment_branch_policy` are set to the same value",
- "examples": null
- }
- ],
- "renamed": null
- },
{
"name": "Set status check contexts",
"scope": "repos",
diff --git a/src/generated/endpoints.ts b/src/generated/endpoints.ts
index e268b82f8..16a071234 100644
--- a/src/generated/endpoints.ts
+++ b/src/generated/endpoints.ts
@@ -962,9 +962,6 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
{ mediaType: { previews: ["dorian"] } },
],
compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
- createAnEnvironment: [
- "POST /repos/{owner}/{repo}/environments/{environment_name}",
- ],
createCommitComment: [
"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments",
],
@@ -982,6 +979,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
createForAuthenticatedUser: ["POST /user/repos"],
createFork: ["POST /repos/{owner}/{repo}/forks"],
createInOrg: ["POST /orgs/{org}/repos"],
+ createOrUpdateEnvironment: [
+ "PUT /repos/{owner}/{repo}/environments/{environment_name}",
+ ],
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
createPagesSite: [
"POST /repos/{owner}/{repo}/pages",
@@ -1212,9 +1212,6 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
{},
{ mapToData: "apps" },
],
- setEnvironmentProtectionRules: [
- "PUT /repos/{owner}/{repo}/environments/{environment_name}",
- ],
setStatusCheckContexts: [
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
{},
diff --git a/src/generated/method-types.ts b/src/generated/method-types.ts
index 27c935b94..5f2a9b2ba 100644
--- a/src/generated/method-types.ts
+++ b/src/generated/method-types.ts
@@ -5869,22 +5869,6 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
- /**
- * Create an environment for a repository. If an environment with the specified name already exists, the existing environment will be returned.
- *
- * The 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)".
- *
- * You must authenticate using an access token with the repo scope to use this endpoint.
- */
- createAnEnvironment: {
- (
- params?: RestEndpointMethodTypes["repos"]["createAnEnvironment"]["parameters"]
- ): Promise<
- RestEndpointMethodTypes["repos"]["createAnEnvironment"]["response"]
- >;
- defaults: RequestInterface["defaults"];
- endpoint: EndpointInterface<{ url: string }>;
- };
/**
* Create a comment for a commit using its `:commit_sha`.
*
@@ -6078,6 +6062,24 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
+ /**
+ * 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)."
+ *
+ * **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)."
+ *
+ * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)."
+ *
+ * You must authenticate using an access token with the repo scope to use this endpoint.
+ */
+ createOrUpdateEnvironment: {
+ (
+ params?: RestEndpointMethodTypes["repos"]["createOrUpdateEnvironment"]["parameters"]
+ ): Promise<
+ RestEndpointMethodTypes["repos"]["createOrUpdateEnvironment"]["response"]
+ >;
+ defaults: RequestInterface["defaults"];
+ endpoint: EndpointInterface<{ url: string }>;
+ };
/**
* Creates a new file or replaces an existing file in a repository.
*/
@@ -7539,22 +7541,6 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
- /**
- * 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)."
- *
- * **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)."
- *
- * You must authenticate using an access token with the repo scope to use this endpoint.
- */
- setEnvironmentProtectionRules: {
- (
- params?: RestEndpointMethodTypes["repos"]["setEnvironmentProtectionRules"]["parameters"]
- ): Promise<
- RestEndpointMethodTypes["repos"]["setEnvironmentProtectionRules"]["response"]
- >;
- defaults: RequestInterface["defaults"];
- endpoint: EndpointInterface<{ url: string }>;
- };
/**
* Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
*/
diff --git a/src/generated/parameters-and-response-types.ts b/src/generated/parameters-and-response-types.ts
index d3b18c4bd..89661d2b5 100644
--- a/src/generated/parameters-and-response-types.ts
+++ b/src/generated/parameters-and-response-types.ts
@@ -3466,14 +3466,6 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /repos/{owner}/{repo}/compare/{base}...{head}"]["response"];
};
- createAnEnvironment: {
- parameters: RequestParameters &
- Omit<
- Endpoints["POST /repos/{owner}/{repo}/environments/{environment_name}"]["parameters"],
- "baseUrl" | "headers" | "mediaType"
- >;
- response: Endpoints["POST /repos/{owner}/{repo}/environments/{environment_name}"]["response"];
- };
createCommitComment: {
parameters: RequestParameters &
Omit<
@@ -3554,6 +3546,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["POST /orgs/{org}/repos"]["response"];
};
+ createOrUpdateEnvironment: {
+ parameters: RequestParameters &
+ Omit<
+ Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}"]["parameters"],
+ "baseUrl" | "headers" | "mediaType"
+ >;
+ response: Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}"]["response"];
+ };
createOrUpdateFileContents: {
parameters: RequestParameters &
Omit<
@@ -4442,14 +4442,6 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"]["response"];
};
- setEnvironmentProtectionRules: {
- parameters: RequestParameters &
- Omit<
- Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}"]["parameters"],
- "baseUrl" | "headers" | "mediaType"
- >;
- response: Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}"]["response"];
- };
setStatusCheckContexts: {
parameters: RequestParameters &
Omit<
|