From 88c313b5bf256c77e450a6f274cc5358f5f0999f Mon Sep 17 00:00:00 2001 From: Taichi Sasaki Date: Wed, 21 Sep 2022 20:10:14 +0900 Subject: [PATCH] Add response map function --- src/fields.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fields.ts b/src/fields.ts index d8e2ce77..d0584a35 100644 --- a/src/fields.ts +++ b/src/fields.ts @@ -110,6 +110,12 @@ export class FieldFactory { repo: context.repo.repo, run_id: context.runId, }, + (response, done) => { + if (response.data.find(job => this.isCurrentJobName(job.name))) { + done(); + } + return response.data; + }, ); const currentJob = jobs.find(job => this.isCurrentJobName(job.name)); if (currentJob === undefined) { @@ -148,6 +154,12 @@ export class FieldFactory { repo: context.repo.repo, run_id: context.runId, }, + (response, done) => { + if (response.data.find(job => this.isCurrentJobName(job.name))) { + done(); + } + return response.data; + }, ); const currentJob = jobs.find(job => this.isCurrentJobName(job.name)); if (currentJob === undefined) {