Skip to content

Commit

Permalink
Merge pull request #88 from wellneverknow/empty-strings
Browse files Browse the repository at this point in the history
chore: exclude files with empty strings checker
  • Loading branch information
rndquu authored Dec 19, 2024
2 parents ca42c18 + 573872f commit 1d6e41b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/empty-string-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1d6e41b

Please sign in to comment.