fix(ci): lire les horodatages Gitea 1.25
This commit is contained in:
@@ -78,8 +78,10 @@ function toDurationSeconds(startedAt, completedAt) {
|
||||
|
||||
/** Normalise les exécutions CI pour le webhook et le dashboard. */
|
||||
function normalizeWorkflowRun(run) {
|
||||
const startedAt = run.run_started_at || run.started_at || null;
|
||||
const completedAt = run.updated_at || (run.status === 'completed' ? run.created_at : null);
|
||||
// Gitea 1.25 renvoie started_at/completed_at (et non les champs GitHub).
|
||||
// Les aliases conservent la compatibilité avec d’éventuelles versions futures.
|
||||
const startedAt = run.started_at || run.run_started_at || null;
|
||||
const completedAt = run.completed_at || run.run_completed_at || run.updated_at || null;
|
||||
return {
|
||||
id: run.id,
|
||||
name: run.name || run.workflow_id || 'Validation CI',
|
||||
|
||||
@@ -7,9 +7,8 @@ const run = normalizeWorkflowRun({
|
||||
status: 'completed',
|
||||
conclusion: 'success',
|
||||
head_sha: 'abcdef123456',
|
||||
created_at: '2026-08-18T10:00:00Z',
|
||||
run_started_at: '2026-08-18T10:00:10Z',
|
||||
updated_at: '2026-08-18T10:02:15Z',
|
||||
started_at: '2026-08-18T10:00:10Z',
|
||||
completed_at: '2026-08-18T10:02:15Z',
|
||||
});
|
||||
|
||||
assert.equal(run.commit, 'abcdef123456');
|
||||
|
||||
Reference in New Issue
Block a user