Skip to content

Commit

Permalink
fix(metrics): changes check for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pixari committed Mar 20, 2023
1 parent 8371e44 commit 275df3b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/metrics/workflows/metricsConditions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { collectWorkflowsMetrics } from ".";
import { Conditions, DataEvent, DataEventSignature } from "../../interfaces";

const isSignedAsWorkflowJob = (dataEvent: DataEvent) =>
dataEvent.dataEventSignature === DataEventSignature.WorkflowJob;
const isSignedAsWorkflowJob = (dataEvent: DataEvent) => {
if (dataEvent.dataEventSignature !== DataEventSignature.WorkflowJob) {
return false;
}

if (dataEvent.payload.action !== "completed") {
return false;
}

return true;
};

const conditions: Conditions = [
[isSignedAsWorkflowJob, collectWorkflowsMetrics],
Expand Down

0 comments on commit 275df3b

Please sign in to comment.