Skip to content

Commit

Permalink
Merge pull request #4 from YaroslavRepeta/patch-1
Browse files Browse the repository at this point in the history
Fix bug with milliseconds precision
  • Loading branch information
aurelien-baudet authored Nov 4, 2021
2 parents 6bf2942 + 881826e commit cf3498d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/workflow-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class WorkflowHandler {
debug('List Workflow Runs', response);

const runs = response.data.workflow_runs
.filter((r: any) => new Date(r.created_at).valueOf() >= this.triggerDate);
.filter((r: any) => new Date(r.created_at).setMilliseconds(0) >= this.triggerDate);
debug(`Filtered Workflow Runs (after trigger date: ${new Date(this.triggerDate).toISOString()})`, runs.map((r: any) => ({
id: r.id,
name: r.name,
Expand Down Expand Up @@ -190,4 +190,4 @@ export class WorkflowHandler {
private isFilename(workflowRef: string) {
return /.+\.ya?ml$/.test(workflowRef);
}
}
}

0 comments on commit cf3498d

Please sign in to comment.