Skip to content

dependabit / manifest/src / readConfig

Function: readConfig()

ts
function readConfig(path): Promise<{
  dependencies?: {
     issues?: {
        aiAgentAssignment?: {
           breaking?: string;
           enabled: boolean;
           major?: string;
           minor?: string;
        };
        assignees: string[];
        bodyTemplate?: string;
        labels: string[];
        titleTemplate: string;
     };
     monitoring?: {
        checkFrequency: "hourly" | "daily" | "weekly" | "monthly";
        enabled: boolean;
        ignoreChanges: boolean;
        severityOverride?: "breaking" | "major" | "minor";
     };
     schedule?: {
        day?:   | "monday"
           | "tuesday"
           | "wednesday"
           | "thursday"
           | "friday"
           | "saturday"
           | "sunday";
        interval: "hourly" | "daily" | "weekly" | "monthly";
        time?: string;
        timezone: string;
     };
     url: string;
  }[];
  ignore?: {
     patterns?: string[];
     types?: (
        | "reference-implementation"
        | "schema"
        | "documentation"
        | "research-paper"
        | "api-example"
       | "other")[];
     urls?: string[];
     useGitExcludes: boolean;
  };
  issues?: {
     aiAgentAssignment?: {
        breaking?: string;
        enabled: boolean;
        major?: string;
        minor?: string;
     };
     assignees: string[];
     bodyTemplate?: string;
     labels: string[];
     titleTemplate: string;
  };
  llm?: {
     maxTokens: number;
     model?: string;
     provider: "github-copilot" | "claude" | "openai" | "azure-openai";
     temperature: number;
  };
  monitoring?: {
     autoUpdate: boolean;
     enabled: boolean;
     falsePositiveThreshold: number;
  };
  schedule: {
     day?:   | "monday"
        | "tuesday"
        | "wednesday"
        | "thursday"
        | "friday"
        | "saturday"
        | "sunday";
     interval: "hourly" | "daily" | "weekly" | "monthly";
     time?: string;
     timezone: string;
  };
  version: "1";
}>;

Defined in: packages/manifest/src/config.ts:24

Reads a YAML configuration file from disk, parses it, and validates it against DependabitConfigSchema.

Parameters

ParameterTypeDescription
pathstringPath to the .dependabit.yml (or .json) file.

Returns

Promise<{ dependencies?: { issues?: { aiAgentAssignment?: { breaking?: string; enabled: boolean; major?: string; minor?: string; }; assignees: string[]; bodyTemplate?: string; labels: string[]; titleTemplate: string; }; monitoring?: { checkFrequency: "hourly" | "daily" | "weekly" | "monthly"; enabled: boolean; ignoreChanges: boolean; severityOverride?: "breaking" | "major" | "minor"; }; schedule?: { day?: | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"; interval: "hourly" | "daily" | "weekly" | "monthly"; time?: string; timezone: string; }; url: string; }[]; ignore?: { patterns?: string[]; types?: ( | "reference-implementation" | "schema" | "documentation" | "research-paper" | "api-example" | "other")[]; urls?: string[]; useGitExcludes: boolean; }; issues?: { aiAgentAssignment?: { breaking?: string; enabled: boolean; major?: string; minor?: string; }; assignees: string[]; bodyTemplate?: string; labels: string[]; titleTemplate: string; }; llm?: { maxTokens: number; model?: string; provider: "github-copilot" | "claude" | "openai" | "azure-openai"; temperature: number; }; monitoring?: { autoUpdate: boolean; enabled: boolean; falsePositiveThreshold: number; }; schedule: { day?: | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"; interval: "hourly" | "daily" | "weekly" | "monthly"; time?: string; timezone: string; }; version: "1"; }>

The validated DependabitConfig object.

Throws

If the YAML does not match the config schema.

Throws

If the file cannot be read.

Pitfalls

  • YAML comments are parsed but not preserved in the returned object. A subsequent stringifyConfig call will lose all comments.
  • Duplicate YAML keys are silently overwritten by the YAML parser (last value wins) — no warning is emitted.

Released under the MIT License.