Skip to content
Merged
Changes from all commits
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
28 changes: 21 additions & 7 deletions .github/workflows/regress-sec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,27 @@ jobs:
script: |
const fs = require('fs');
const path = require('path');
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, {
...context.repo,
run_id: context.runId,
filter: 'all',
per_page: 100,
});
fs.writeFileSync(path.join(process.env.RUNNER_TEMP, 'sec-jobs.json'), JSON.stringify(jobs));
// Listing every attempt at once (filter: 'all') fails with a persistent
// 502 from the API once a run has several attempts, so the attempts
// are listed one by one. A job appears from the attempt it ran in
// onward, so its first appearance is its attempt; the summary then
// keeps the latest attempt of each job and its result artifact.
const attempts = Number(process.env.GITHUB_RUN_ATTEMPT);
const jobsById = new Map();
for (let attempt = 1; attempt <= attempts; attempt++) {
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRunAttempt, {
...context.repo,
run_id: context.runId,
attempt_number: attempt,
per_page: 100,
});
for (const job of jobs) {
if (!jobsById.has(job.id)) {
jobsById.set(job.id, { ...job, run_attempt: attempt });
}
}
}
fs.writeFileSync(path.join(process.env.RUNNER_TEMP, 'sec-jobs.json'), JSON.stringify([...jobsById.values()]));

- name: Download regression results
id: results
Expand Down
Loading