From a597a842ab5ff0b35a92f32dcf4dc45c9331227d Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Sat, 18 May 2024 16:03:29 +0900 Subject: [PATCH] chore: return config instead of re-generating it --- src/github/utils/config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/github/utils/config.ts b/src/github/utils/config.ts index be999f1..6de223c 100644 --- a/src/github/utils/config.ts +++ b/src/github/utils/config.ts @@ -1,14 +1,14 @@ import { Value } from "@sinclair/typebox/value"; -import { GitHubContext } from "../github-context"; +import { generateConfiguration } from "@ubiquibot/configuration"; import YAML from "yaml"; +import { GitHubContext } from "../github-context"; import { expressionRegex } from "../types/plugin"; import { configSchema, PluginConfiguration } from "../types/plugin-configuration"; import { eventNames } from "../types/webhook-events"; -import { BotConfig, generateConfiguration } from "@ubiquibot/configuration"; const UBIQUIBOT_CONFIG_FULL_PATH = ".github/.ubiquibot-config.yml"; -export async function getConfig(context: GitHubContext): Promise { +export async function getConfig(context: GitHubContext): Promise { const payload = context.payload; const defaultConfiguration = generateConfiguration(); if (!("repository" in payload) || !payload.repository) { @@ -35,7 +35,7 @@ export async function getConfig(context: GitHubContext): Promise { checkPluginChains(config); - return generateConfiguration(Value.Default(configSchema, _repoConfig) as BotConfig); + return config; } function checkPluginChains(config: PluginConfiguration) {