Skip to content

Commit

Permalink
chore: return config instead of re-generating it
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed May 18, 2024
1 parent 10602e2 commit a597a84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/github/utils/config.ts
Original file line number Diff line number Diff line change
@@ -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<BotConfig> {
export async function getConfig(context: GitHubContext): Promise<PluginConfiguration> {
const payload = context.payload;
const defaultConfiguration = generateConfiguration();
if (!("repository" in payload) || !payload.repository) {
Expand All @@ -35,7 +35,7 @@ export async function getConfig(context: GitHubContext): Promise<BotConfig> {

checkPluginChains(config);

return generateConfiguration(Value.Default(configSchema, _repoConfig) as BotConfig);
return config;
}

function checkPluginChains(config: PluginConfiguration) {
Expand Down

0 comments on commit a597a84

Please sign in to comment.