diff --git a/.github/empty-string-checker.ts b/.github/empty-string-checker.ts index ff94e81..d553cc8 100644 --- a/.github/empty-string-checker.ts +++ b/.github/empty-string-checker.ts @@ -6,6 +6,11 @@ const token = process.env.GITHUB_TOKEN; const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/") || []; const pullNumber = process.env.GITHUB_PR_NUMBER || process.env.PULL_REQUEST_NUMBER || "0"; const baseRef = process.env.GITHUB_BASE_REF; +const excludedFiles: string[] = process.env.EXCLUDED_FILES + ? process.env.EXCLUDED_FILES.split("\n") + .map((file) => file.trim()) + .filter(Boolean) + : []; if (!token || !owner || !repo || pullNumber === "0" || !baseRef) { core.setFailed("Missing required environment variables."); @@ -96,6 +101,11 @@ function parseDiffForEmptyStrings(diff: string) { return; } + // Skip files in excludedFiles + if (excludedFiles.includes(currentFile)) { + return; + } + // Only process TypeScript files if (!currentFile?.endsWith(".ts")) { return;