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] allowed_merge_methods missing in repository-rule-pull-request #4405

Open
JoshuaKGoldberg opened this issue Dec 21, 2024 · 0 comments

Comments

@JoshuaKGoldberg
Copy link

JoshuaKGoldberg commented Dec 21, 2024

Schema Inaccuracy

"POST /repos/{owner}/{repo}/rulesets"'s rules > { type: "pull-request" }'s parameters define what can be given for the PR rule parameters in a ruleset. They're documented on https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset--fine-grained-access-tokens.

Expanding Body Parameters > rules > pull_request shows allowed_merge_methods as the first property:

allowed_merge_methods array of strings
When merging pull requests, you can allow any combination of merge commits, squashing, or rebasing. At least one option must be enabled.

Expected

This should be allowed in the Rest API types, right?

Reproduction Steps

In short, https://github.com/JoshuaKGoldberg/repros/blob/github-rulesets-post-api-allowed_merge_methods/index.ts:

gh pr checkout https://github.com/JoshuaKGoldberg/repros --branch github-rulesets-post-api-allowed_merge_methods
cd repros
npm i
npm run tsc
index.ts:21:9 - error TS2353: Object literal may only specify known properties, and 'allowed_merge_methods' does not exist in type '{ dismiss_stale_reviews_on_push: boolean; require_code_owner_review: boolean; require_last_push_approval: boolean; required_approving_review_count: number; required_review_thread_resolution: boolean; }'.

21         allowed_merge_methods: ["squash"],
           ~~~~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant