@@ -113,7 +113,7 @@ var Inputs;
113113 Inputs["Title"] = "title";
114114 Inputs["Path"] = "path";
115115 Inputs["Token"] = "token";
116- Inputs["Token "] = "token ";
116+ Inputs["ChangedSince "] = "changed-since ";
117117})(Inputs = exports.Inputs || (exports.Inputs = {}));
118118
119119
@@ -185,15 +185,20 @@ function run() {
185185 const name = core.getInput(constants_1.Inputs.Name);
186186 const title = core.getInput(constants_1.Inputs.Title);
187187 const commit = core.getInput(constants_1.Inputs.Commit);
188+ const changedSince = core.getInput(constants_1.Inputs.ChangedSince);
189+ const filter = yield getFilter(commit, changedSince);
190+ core.debug(`Got the filter of ${filter} files, e.g. ${filter.slice(0, 3)}`);
188191 const searchResult = yield search_1.findResults(path);
189192 if (searchResult.filesToUpload.length === 0) {
190193 core.warning(`No files were found for the provided path: ${path}. No results will be uploaded.`);
191194 }
192195 else {
193196 core.info(`With the provided path, there will be ${searchResult.filesToUpload.length} results uploaded`);
194197 core.debug(`Root artifact directory is ${searchResult.rootDirectory}`);
195- const annotations = ramda_1.chain(annotations_1.annotationsForPath, searchResult.filesToUpload);
196- core.debug(`Grouping ${annotations.length} annotations into chunks of ${MAX_ANNOTATIONS_PER_REQUEST}`);
198+ const allAnnotations = ramda_1.chain(annotations_1.annotationsForPath, searchResult.filesToUpload);
199+ const annotations = filter.length == 0 ? allAnnotations :
200+ allAnnotations.filter(annotation => filter.includes(annotation.path));
201+ core.debug(`Grouping ${annotations.length} filtered out of ${allAnnotations.length} annotations into chunks of ${MAX_ANNOTATIONS_PER_REQUEST}`);
197202 const groupedAnnotations = annotations.length > MAX_ANNOTATIONS_PER_REQUEST
198203 ? ramda_1.splitEvery(MAX_ANNOTATIONS_PER_REQUEST, annotations)
199204 : [annotations];
@@ -226,6 +231,20 @@ function getConclusion(annotations) {
226231 }
227232 return 'success';
228233}
234+ function getFilter(commit, changedSince) {
235+ return __awaiter(this, void 0, void 0, function* () {
236+ if (changedSince == "") {
237+ return [];
238+ }
239+ const octokit = github_2.getOctokit(core.getInput(constants_1.Inputs.Token));
240+ const head_sha = commit ||
241+ (github_2.context.payload.pull_request && github_2.context.payload.pull_request.head.sha) ||
242+ github_2.context.sha;
243+ const req = Object.assign(Object.assign({}, github_2.context.repo), { head: head_sha, base: changedSince });
244+ const compare = yield octokit.repos.compareCommits(req);
245+ return compare.data.files.map(file => file.filename);
246+ });
247+ }
229248function createCheck(name, commit, title, annotations, processedErrors, numErrors, conclusion) {
230249 return __awaiter(this, void 0, void 0, function* () {
231250 const head_sha = commit ||
0 commit comments