-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documented
Description
What happened?
I'm working on a script to configure merge queues across many repos (code snippet below).
I noticed that 3 of the fields I tried to configure had TS errors. If I use @ts-expect-error
it works correctly (compare to values here in REST API docs here: https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset).
I'm unsure if this is just an oversight or if the merge-queue and ruleset features have different valid values for Github Enterprise plans etc.
Code snippet:
client.repos.createRepoRuleset({
enforcement: 'active',
owner,
repo,
name: this.rulesetName,
target: 'branch',
conditions: {
ref_name: {
include: ['refs/heads/renovate/rollup'],
exclude: [],
},
},
rules: [
{
type: 'merge_queue', // TS error
parameters: {
merge_method: 'SQUASH', // TS error
max_entries_to_build: 5,
min_entries_to_merge: 1,
max_entries_to_merge: 5,
min_entries_to_merge_wait_minutes: 5,
grouping_strategy: 'ALLGREEN',
check_response_timeout_minutes: 60,
},
},
{
type: 'required_status_checks',
parameters: {
strict_required_status_checks_policy: false,
do_not_enforce_on_create: false, // TS error
required_status_checks: await this.getRequiredStatusChecks({
repo,
}),
},
},
],
});
Versions
@octokit/rest
21.0.2node
18.20.3typescript
5.6.2
Relevant log output
First error
ts: Type '"merge_queue"' is not assignable to type '"creation" | "update" | "deletion" | "required_linear_history" | "required_deployments" | "required_signatures" | "pull_request" | "required_status_checks" | "non_fast_forward" | ... 9 more ... | "workflows"'.
Second error
ts: Object literal may only specify known properties, and 'merge_method' does not exist in type '{ workflows: { path: string; ref?: string | undefined; repository_id: number; sha?: string | undefined; }[]; }'.
Third error
ts: Object literal may only specify known properties, and 'do_not_enforce_on_create' does not exist in type '{ required_status_checks: { context: string; integration_id?: number | undefined; }[]; strict_required_status_checks_policy: boolean; }'.
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't working as documentedSomething isn't working as documented
Type
Projects
Status
🔥 Backlog