Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kristof-mattei opened this issue Aug 10, 2024 · 1 comment
Labels

Comments

@kristof-mattei
Copy link

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.

@duythuan1234
Copy link

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

@duythuan1234 duythuan1234 mentioned this issue Sep 11, 2024
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants