Skip to content

Commit b4ce9a1

Browse files
committed
feat: add support for new deployment branch policy APIs (createDeploymentBranchPolicy, deleteDeploymentBranchPolicy, getDeploymentBranchPolicy,
`listDeploymentBranchPolicies`, `updateDeploymentBranchPolicy`)
1 parent 3b3da2b commit b4ce9a1

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

src/generated/endpoints.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
11691169
createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
11701170
createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
11711171
createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
1172+
createDeploymentBranchPolicy: [
1173+
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
1174+
],
11721175
createDeploymentStatus: [
11731176
"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
11741177
],
@@ -1217,6 +1220,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
12171220
deleteDeployment: [
12181221
"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}",
12191222
],
1223+
deleteDeploymentBranchPolicy: [
1224+
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}",
1225+
],
12201226
deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
12211227
deleteInvitation: [
12221228
"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}",
@@ -1294,6 +1300,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
12941300
getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
12951301
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
12961302
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
1303+
getDeploymentBranchPolicy: [
1304+
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}",
1305+
],
12971306
getDeploymentStatus: [
12981307
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}",
12991308
],
@@ -1350,6 +1359,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
13501359
listCommits: ["GET /repos/{owner}/{repo}/commits"],
13511360
listContributors: ["GET /repos/{owner}/{repo}/contributors"],
13521361
listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
1362+
listDeploymentBranchPolicies: [
1363+
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
1364+
],
13531365
listDeploymentStatuses: [
13541366
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
13551367
],
@@ -1442,6 +1454,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
14421454
"PUT /repos/{owner}/{repo}/branches/{branch}/protection",
14431455
],
14441456
updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
1457+
updateDeploymentBranchPolicy: [
1458+
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}",
1459+
],
14451460
updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
14461461
updateInvitation: [
14471462
"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}",

src/generated/method-types.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8075,6 +8075,20 @@ export type RestEndpointMethods = {
80758075
defaults: RequestInterface["defaults"];
80768076
endpoint: EndpointInterface<{ url: string }>;
80778077
};
8078+
/**
8079+
* Creates a deployment branch policy for an environment.
8080+
*
8081+
* You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint.
8082+
*/
8083+
createDeploymentBranchPolicy: {
8084+
(
8085+
params?: RestEndpointMethodTypes["repos"]["createDeploymentBranchPolicy"]["parameters"]
8086+
): Promise<
8087+
RestEndpointMethodTypes["repos"]["createDeploymentBranchPolicy"]["response"]
8088+
>;
8089+
defaults: RequestInterface["defaults"];
8090+
endpoint: EndpointInterface<{ url: string }>;
8091+
};
80788092
/**
80798093
* Users with `push` access can create deployment statuses for a given deployment.
80808094
*
@@ -8411,6 +8425,20 @@ export type RestEndpointMethods = {
84118425
defaults: RequestInterface["defaults"];
84128426
endpoint: EndpointInterface<{ url: string }>;
84138427
};
8428+
/**
8429+
* Deletes a deployment branch policy for an environment.
8430+
*
8431+
* You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint.
8432+
*/
8433+
deleteDeploymentBranchPolicy: {
8434+
(
8435+
params?: RestEndpointMethodTypes["repos"]["deleteDeploymentBranchPolicy"]["parameters"]
8436+
): Promise<
8437+
RestEndpointMethodTypes["repos"]["deleteDeploymentBranchPolicy"]["response"]
8438+
>;
8439+
defaults: RequestInterface["defaults"];
8440+
endpoint: EndpointInterface<{ url: string }>;
8441+
};
84148442
/**
84158443
* Deletes a file in a repository.
84168444
*
@@ -8982,6 +9010,20 @@ export type RestEndpointMethods = {
89829010
defaults: RequestInterface["defaults"];
89839011
endpoint: EndpointInterface<{ url: string }>;
89849012
};
9013+
/**
9014+
* Gets a deployment branch policy for an environment.
9015+
*
9016+
* Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.
9017+
*/
9018+
getDeploymentBranchPolicy: {
9019+
(
9020+
params?: RestEndpointMethodTypes["repos"]["getDeploymentBranchPolicy"]["parameters"]
9021+
): Promise<
9022+
RestEndpointMethodTypes["repos"]["getDeploymentBranchPolicy"]["response"]
9023+
>;
9024+
defaults: RequestInterface["defaults"];
9025+
endpoint: EndpointInterface<{ url: string }>;
9026+
};
89859027
/**
89869028
* Users with pull access can view a deployment status for a deployment:
89879029
*/
@@ -9428,6 +9470,20 @@ export type RestEndpointMethods = {
94289470
defaults: RequestInterface["defaults"];
94299471
endpoint: EndpointInterface<{ url: string }>;
94309472
};
9473+
/**
9474+
* Lists the deployment branch policies for an environment.
9475+
*
9476+
* Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.
9477+
*/
9478+
listDeploymentBranchPolicies: {
9479+
(
9480+
params?: RestEndpointMethodTypes["repos"]["listDeploymentBranchPolicies"]["parameters"]
9481+
): Promise<
9482+
RestEndpointMethodTypes["repos"]["listDeploymentBranchPolicies"]["response"]
9483+
>;
9484+
defaults: RequestInterface["defaults"];
9485+
endpoint: EndpointInterface<{ url: string }>;
9486+
};
94319487
/**
94329488
* Users with pull access can view deployment statuses for a deployment:
94339489
*/
@@ -9954,6 +10010,20 @@ export type RestEndpointMethods = {
995410010
defaults: RequestInterface["defaults"];
995510011
endpoint: EndpointInterface<{ url: string }>;
995610012
};
10013+
/**
10014+
* Updates a deployment branch policy for an environment.
10015+
*
10016+
* You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint.
10017+
*/
10018+
updateDeploymentBranchPolicy: {
10019+
(
10020+
params?: RestEndpointMethodTypes["repos"]["updateDeploymentBranchPolicy"]["parameters"]
10021+
): Promise<
10022+
RestEndpointMethodTypes["repos"]["updateDeploymentBranchPolicy"]["response"]
10023+
>;
10024+
defaults: RequestInterface["defaults"];
10025+
endpoint: EndpointInterface<{ url: string }>;
10026+
};
995710027
/**
995810028
* Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).
995910029
*/

src/generated/parameters-and-response-types.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4456,6 +4456,14 @@ export type RestEndpointMethodTypes = {
44564456
>;
44574457
response: Endpoints["POST /repos/{owner}/{repo}/deployments"]["response"];
44584458
};
4459+
createDeploymentBranchPolicy: {
4460+
parameters: RequestParameters &
4461+
Omit<
4462+
Endpoints["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"]["parameters"],
4463+
"baseUrl" | "headers" | "mediaType"
4464+
>;
4465+
response: Endpoints["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"]["response"];
4466+
};
44594467
createDeploymentStatus: {
44604468
parameters: RequestParameters &
44614469
Omit<
@@ -4648,6 +4656,14 @@ export type RestEndpointMethodTypes = {
46484656
>;
46494657
response: Endpoints["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"]["response"];
46504658
};
4659+
deleteDeploymentBranchPolicy: {
4660+
parameters: RequestParameters &
4661+
Omit<
4662+
Endpoints["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["parameters"],
4663+
"baseUrl" | "headers" | "mediaType"
4664+
>;
4665+
response: Endpoints["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["response"];
4666+
};
46514667
deleteFile: {
46524668
parameters: RequestParameters &
46534669
Omit<
@@ -4976,6 +4992,14 @@ export type RestEndpointMethodTypes = {
49764992
>;
49774993
response: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}"]["response"];
49784994
};
4995+
getDeploymentBranchPolicy: {
4996+
parameters: RequestParameters &
4997+
Omit<
4998+
Endpoints["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["parameters"],
4999+
"baseUrl" | "headers" | "mediaType"
5000+
>;
5001+
response: Endpoints["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["response"];
5002+
};
49795003
getDeploymentStatus: {
49805004
parameters: RequestParameters &
49815005
Omit<
@@ -5248,6 +5272,14 @@ export type RestEndpointMethodTypes = {
52485272
>;
52495273
response: Endpoints["GET /repos/{owner}/{repo}/keys"]["response"];
52505274
};
5275+
listDeploymentBranchPolicies: {
5276+
parameters: RequestParameters &
5277+
Omit<
5278+
Endpoints["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"]["parameters"],
5279+
"baseUrl" | "headers" | "mediaType"
5280+
>;
5281+
response: Endpoints["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"]["response"];
5282+
};
52515283
listDeploymentStatuses: {
52525284
parameters: RequestParameters &
52535285
Omit<
@@ -5584,6 +5616,14 @@ export type RestEndpointMethodTypes = {
55845616
>;
55855617
response: Endpoints["PATCH /repos/{owner}/{repo}/comments/{comment_id}"]["response"];
55865618
};
5619+
updateDeploymentBranchPolicy: {
5620+
parameters: RequestParameters &
5621+
Omit<
5622+
Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["parameters"],
5623+
"baseUrl" | "headers" | "mediaType"
5624+
>;
5625+
response: Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"]["response"];
5626+
};
55875627
updateInformationAboutPagesSite: {
55885628
parameters: RequestParameters &
55895629
Omit<

0 commit comments

Comments
 (0)