@@ -42,7 +42,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4242 return (mod && mod.__esModule) ? mod : { "default": mod };
4343};
4444Object.defineProperty(exports, "__esModule", ({ value: true }));
45- exports.postComment = exports.checkFiles = exports.generateIgnore = exports.run = void 0;
45+ exports.postComment = exports.checkFiles = exports.getIgnoredFiles = exports. generateIgnore = exports.run = void 0;
4646const fs_1 = __nccwpck_require__(7147);
4747const core = __importStar(__nccwpck_require__(2186));
4848const github = __importStar(__nccwpck_require__(5438));
@@ -56,6 +56,7 @@ function run() {
5656 const commentSuffix = core.getInput('commentSuffix') || '';
5757 const checkboxes = core.getBooleanInput('checkboxes') || false;
5858 const includeDeleted = core.getBooleanInput('includeDeleted') || false;
59+ const ignoredFiles = yield getIgnoredFiles(core.getInput('ignoredFiles') || '');
5960 const prNumber = getPrNumber();
6061 if (!prNumber) {
6162 console.log('Could not get pull request number from context, exiting');
@@ -66,6 +67,7 @@ function run() {
6667 const changedFiles = yield getChangedFiles(client, prNumber, includeDeleted);
6768 const ignored = (0, ignore_1.default)();
6869 generateIgnore(ignored, codeOwnersPath);
70+ ignoredFiles.forEach((ignoredFile) => ignored.add(ignoredFile));
6971 const result = yield checkFiles(ignored, changedFiles);
7072 if (result.length !== 0) {
7173 yield postComment(result, checkboxes, commentPrefix, commentSuffix);
@@ -103,13 +105,36 @@ function getChangedFiles(client, prNumber, includeDeleted) {
103105 const changedFiles = listFilesResponse
104106 .filter((f) => includeDeleted || f.status !== 'deleted')
105107 .map((f) => f.filename);
106- core.debug('Found changed files:');
107- for (const file of changedFiles) {
108- core.debug(` ${file}`);
108+ if (changedFiles.length > 0) {
109+ core.debug('Found changed files:');
110+ for (const file of changedFiles) {
111+ core.debug(` ${file}`);
112+ }
113+ }
114+ else {
115+ core.debug('No changed files were found.');
109116 }
110117 return changedFiles;
111118 });
112119}
120+ function getIgnoredFiles(ignoredLinesList) {
121+ return __awaiter(this, void 0, void 0, function* () {
122+ const ignoredFiles = ignoredLinesList
123+ .split('\n')
124+ .filter((ignoredFile) => ignoredFile.trim().length > 0);
125+ if (ignoredFiles.length > 0) {
126+ core.debug('Ignoring files:');
127+ for (const file of ignoredFiles) {
128+ core.debug(` ${file}`);
129+ }
130+ }
131+ else {
132+ core.debug('No ignored files were found.');
133+ }
134+ return ignoredFiles;
135+ });
136+ }
137+ exports.getIgnoredFiles = getIgnoredFiles;
113138function checkFiles(ig, changedFiles) {
114139 return __awaiter(this, void 0, void 0, function* () {
115140 const failedList = [];
0 commit comments