[Schema Inaccuracy] Create a deployment branch not listing defaults & required.

Open
#3,841 4 comments 0 reactions 1 assignee View on GitHub

@nickfloyd is already working on this.

Since Nov 6, 2025.

Assessment

This issue has not been assessed yet.

Description

feature

Schema Inaccuracy

https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy

Incorret request & response.

Expected

  • Description of the type parameter when absent to default to branch.
  • Response to list id, node_id, name and type as required so that they are not emitted as type | undefined in JS.

Reproduction Steps

Execute

gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/environments/ENVIRONMENT_NAME/deployment-branch-policies \
   -f "name=release/*"

Yields

{
  "id": 20029356,
  "node_id": "MDE2OkdhdGVCcmFuY2hQb2xpY3kyMDAyOTM1Ng==",
  "name": "release/*",
  "type": "branch"
}

So omitting type creates a type = branch. Equally there is no way to create a deployment branch policy and not get back and id, node_id, name and a type.

Dominant language
No language data
Stars
1.6k
Forks
342
Avg merge
3h 33m
Merged PRs (30d)
51

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/rest-api-description

All issues in github/rest-api-description

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.