Skip to content

[Schema Inaccuracy] allowed_merge_methods missing in repository-rule-pull-request #4405

Open
@JoshuaKGoldberg

Description

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"],
           ~~~~~~~~~~~~~~~~~~~~~

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions