Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.4 #10

Merged
merged 3 commits into from
Oct 9, 2023
Merged

v5.4 #10

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Extra debugging
  • Loading branch information
carmocca committed Oct 9, 2023
commit 0a923aca0ded65964c69c45ec3b4befb03eb41e9
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