ci: prefer latest PR build run for artifact comments
This commit is contained in:
6
.github/workflows/comment-pr-artifacts.yml
vendored
6
.github/workflows/comment-pr-artifacts.yml
vendored
@@ -66,7 +66,11 @@ jobs:
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
matchedRun = runs.find((run) => run.head_sha === headSha);
|
||||
const matchingRuns = runs
|
||||
.filter((run) => run.head_sha === headSha)
|
||||
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
||||
|
||||
matchedRun = matchingRuns[0] || null;
|
||||
if (matchedRun && matchedRun.status === 'completed') {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user