From 75a6e4983403973a8e25e3c25bbadee0afd4190c Mon Sep 17 00:00:00 2001 From: nleanba <25827850+nleanba@users.noreply.github.com> Date: Tue, 5 Mar 2024 13:34:55 +0100 Subject: [PATCH] added till to status if its initially HEAD --- src/JobsDataBase.ts | 2 +- src/action_worker.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/JobsDataBase.ts b/src/JobsDataBase.ts index b959394..651d243 100644 --- a/src/JobsDataBase.ts +++ b/src/JobsDataBase.ts @@ -48,7 +48,7 @@ export class JobsDataBase { ); } - setStatus(job: Job, status: "failed" | "completed") { + setStatus(job: Job, status: "failed" | "completed" | "pending") { const jobStatus: JobStatus = { job, status, diff --git a/src/action_worker.ts b/src/action_worker.ts index ffe8e30..10a5264 100644 --- a/src/action_worker.ts +++ b/src/action_worker.ts @@ -111,6 +111,7 @@ function run() { removed = job.files.removed || []; message = `committed by action runner ${config.sourceRepository} ${job.id}`; + updateLocalData("source", log); // also done by getModifiedAfter } else if (job.from) { const files = getModifiedAfter(job.from, job.till, log); modified = [...files.added, ...files.modified]; @@ -118,6 +119,8 @@ function run() { if (files.till && files.till !== "HEAD") { message = `committed by action runner ${config.sourceRepository}@${files.till}`; + job.till = files.till; + queue.setStatus(job, "pending"); // updates `till` } else { message = `committed by action runner ${config.sourceRepository}@${job.id}`; @@ -128,7 +131,7 @@ function run() { ); } - updateLocalData("source", log); + log(`\nTotal files: ${modified.length + removed.length}\n`); // run saxon on modified files for (const file of modified) {