From d8e1de6f976ecf7a3280bf563246bd53c2826fa6 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 30 Dec 2024 05:44:17 +0900 Subject: [PATCH] chore: improved logs for events --- src/github/utils/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/github/utils/config.ts b/src/github/utils/config.ts index 26305b9..0e85595 100644 --- a/src/github/utils/config.ts +++ b/src/github/utils/config.ts @@ -142,18 +142,19 @@ function checkExpression(value: string, allIds: Set, calledIds: Set { if (!repository || !owner) throw new Error("Repo or owner is not defined"); + const filePath = context.eventHandler.environment === "production" ? CONFIG_FULL_PATH : DEV_CONFIG_FULL_PATH; try { const { data } = await context.octokit.rest.repos.getContent({ owner, repo: repository, - path: context.eventHandler.environment === "production" ? CONFIG_FULL_PATH : DEV_CONFIG_FULL_PATH, + path: filePath, mediaType: { format: "raw" }, }); return data as unknown as string; // this will be a string if media format is raw } catch (err) { // In case of a missing config, do not log is as an error if (err && typeof err === "object" && "status" in err && err.status === 404) { - console.log(`No configuration file was found in the repository ${owner}/${repository}.`); + console.log(`No configuration file was found at ${owner}/${repository}/${filePath}.`); } else { console.error(err); }