{
  "name": "CI Failed Alert",
  "version": 1,
  "nodes": [
    {
      "localID": 0,
      "typeID": "trigger.public_webhook",
      "customName": "GitHub",
      "isDisabled": false,
      "x": 60.0,
      "y": 110.0,
      "config": {
        "hmacEnabled": true,
        "hmacScheme": "github",
        "hmacSecret": "",
        "customArgs": {}
      }
    },
    {
      "localID": 1,
      "typeID": "condition.compare",
      "customName": "Failed run?",
      "isDisabled": false,
      "x": 380.0,
      "y": 110.0,
      "config": {
        "logic": "and",
        "caseInsensitive": false,
        "rules": [
          {
            "field": "body.action",
            "negate": false,
            "operator": "equals",
            "value": "completed"
          },
          {
            "field": "body.workflow_run.conclusion",
            "negate": false,
            "operator": "equals",
            "value": "failure"
          }
        ]
      }
    },
    {
      "localID": 2,
      "typeID": "action.notification",
      "customName": "Tell me",
      "isDisabled": false,
      "x": 700.0,
      "y": 110.0,
      "config": {
        "title": "{{body.repository.name}}: {{body.workflow_run.name}} failed",
        "body": "{{body.workflow_run.head_branch}} · {{body.workflow_run.display_title}}",
        "actionURL": "{{body.workflow_run.html_url}}",
        "forceDisplay": true
      }
    },
    {
      "localID": 3,
      "typeID": "action.log_to_file",
      "customName": "CI log",
      "isDisabled": false,
      "x": 700.0,
      "y": 330.0,
      "config": {
        "filePath": "~/logs/ci-failures.log",
        "format": "text",
        "includeTimestamp": true,
        "lineTemplate": "{{timestamp}} {{body.repository.full_name}} {{body.workflow_run.head_branch}} {{body.workflow_run.html_url}}"
      }
    }
  ],
  "connections": [
    {
      "sourceLocalID": 0,
      "sourcePortID": "outlet_output",
      "targetLocalID": 1,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 1,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 2,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 1,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 3,
      "targetPortID": "inlet_input"
    }
  ],
  "background": {
    "type": "image",
    "ref": {
      "type": "bundled",
      "id": "jade"
    },
    "fit": "cover"
  }
}
