Skip to content

Commit 3045da6

Browse files
Processing only supported files
1 parent cfd5503 commit 3045da6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as github from '@actions/github'
33
import {readFile, writeFile} from 'fs-extra';
44
import {Client} from 'codemaker-sdk';
55
import {commitAndPushSingleFile, getReviewComments} from './utils/githubUtils';
6-
import {langFromFileExtension} from './utils/languageUtils';
6+
import {isFileSupported, langFromFileExtension} from './utils/languageUtils';
77
import {createProcessRequest, processTask} from './utils/codemakerUtils';
88
import {lineNumber, orderComments} from "./utils/commentUtils";
99

@@ -31,6 +31,11 @@ export const runAction = async () => {
3131
for (let i = 0; i < comments.length; i++) {
3232
const comment = comments[i];
3333
const path = comment.path;
34+
if (!isFileSupported(path)) {
35+
console.log(`Skipping unsupported file ${path}`);
36+
continue;
37+
}
38+
3439
const line = lineNumber(comment);
3540
const language = langFromFileExtension(path);
3641
console.log(`Running code generation for file ${path}. Language detected: ${language}. Line number: ${line}. Prompt: ${comment.body}`);

0 commit comments

Comments
 (0)