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. */
|
/** Normalise les exécutions CI pour le webhook et le dashboard. */
|
||||||
function normalizeWorkflowRun(run) {
|
function normalizeWorkflowRun(run) {
|
||||||
const startedAt = run.run_started_at || run.started_at || null;
|
// Gitea 1.25 renvoie started_at/completed_at (et non les champs GitHub).
|
||||||
const completedAt = run.updated_at || (run.status === 'completed' ? run.created_at : null);
|
// 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 {
|
return {
|
||||||
id: run.id,
|
id: run.id,
|
||||||
name: run.name || run.workflow_id || 'Validation CI',
|
name: run.name || run.workflow_id || 'Validation CI',
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ const run = normalizeWorkflowRun({
|
|||||||
status: 'completed',
|
status: 'completed',
|
||||||
conclusion: 'success',
|
conclusion: 'success',
|
||||||
head_sha: 'abcdef123456',
|
head_sha: 'abcdef123456',
|
||||||
created_at: '2026-08-18T10:00:00Z',
|
started_at: '2026-08-18T10:00:10Z',
|
||||||
run_started_at: '2026-08-18T10:00:10Z',
|
completed_at: '2026-08-18T10:02:15Z',
|
||||||
updated_at: '2026-08-18T10:02:15Z',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.equal(run.commit, 'abcdef123456');
|
assert.equal(run.commit, 'abcdef123456');
|
||||||
|
|||||||
Reference in New Issue
Block a user