fix(ci): lire les horodatages Gitea 1.25

This commit is contained in:
Manus AI
2026-08-18 17:50:03 +00:00
parent 40ac705398
commit c3bf677972
2 changed files with 6 additions and 5 deletions

View File

@@ -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',

View File

@@ -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');