Skip to content

Commit

Permalink
Extra debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Oct 9, 2023
1 parent 5b54ba4 commit 0a923ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions dist/check-group/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,16 @@ var getPostedChecks = function (context, sha) { return __awaiter(void 0, void 0,
details_url: checkRun.details_url,
completed_at: new Date(checkRun.completed_at),
};
// "filter: latest" doesnt seem to work as expected so we need to check the completed_at in case of collisions
if (!checkNames[checkRun.name] || checkNames[checkRun.name].completed_at < checkRunData.completed_at) {
if (!checkNames[checkRun.name]) {
checkNames[checkRun.name] = checkRunData;
}
else {
core.debug("Conflict for ".concat(checkRun.name, ": previous=").concat(checkNames[checkRun.name].completed_at, ", new=").concat(checkRunData.completed_at));
// "filter: latest" doesnt seem to work as expected so we need to check `completed_at` in case of collisions
if (checkNames[checkRun.name].completed_at < checkRunData.completed_at) {
checkNames[checkRun.name] = checkRunData;
}
}
});
return [2 /*return*/, checkNames];
}
Expand Down
9 changes: 7 additions & 2 deletions src/check-group/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,14 @@ const getPostedChecks = async (context: Context, sha: string): Promise<Record<st
details_url: checkRun.details_url,
completed_at: new Date(checkRun.completed_at),
}
// "filter: latest" doesnt seem to work as expected so we need to check the completed_at in case of collisions
if (!checkNames[checkRun.name] || checkNames[checkRun.name].completed_at < checkRunData.completed_at) {
if (!checkNames[checkRun.name]) {
checkNames[checkRun.name] = checkRunData;
} else {
core.debug(`Conflict for ${checkRun.name}: previous=${checkNames[checkRun.name].completed_at}, new=${checkRunData.completed_at}`)
// "filter: latest" doesnt seem to work as expected so we need to check `completed_at` in case of collisions
if (checkNames[checkRun.name].completed_at < checkRunData.completed_at) {
checkNames[checkRun.name] = checkRunData;
}
}
},
);
Expand Down

0 comments on commit 0a923ac

Please sign in to comment.