sh.tangled.ci.trigger.json

  1{
  2  "lexicon": 1,
  3  "id": "sh.tangled.ci.trigger",
  4  "defs": {
  5    "push": {
  6      "type": "object",
  7      "required": ["ref", "newSha", "oldSha"],
  8      "properties": {
  9        "ref": {
 10          "type": "string"
 11        },
 12        "newSha": {
 13          "type": "string",
 14          "minLength": 40,
 15          "maxLength": 40
 16        },
 17        "oldSha": {
 18          "type": "string",
 19          "minLength": 40,
 20          "maxLength": 40
 21        }
 22      }
 23    },
 24    "pullRequest": {
 25      "type": "object",
 26      "required": ["targetBranch", "sourceSha"],
 27      "description": "TODO: reference PR record with strongRef instead of embedding raw values",
 28      "properties": {
 29        "action": {
 30          "type": "string",
 31          "description": "the pull request lifecycle action that produced this trigger",
 32          "enum": ["opened", "reopened", "closed", "merged", "synchronize"]
 33        },
 34        "sourceRepo": {
 35          "type": "string",
 36          "format": "did",
 37          "description": "Repository DID to check out code and workflow definitions from, if different from the target repo."
 38        },
 39        "sourceBranch": {
 40          "type": "string"
 41        },
 42        "targetBranch": {
 43          "type": "string"
 44        },
 45        "sourceSha": {
 46          "type": "string",
 47          "minLength": 40,
 48          "maxLength": 40
 49        },
 50        "pull": {
 51          "type": "string",
 52          "format": "at-uri",
 53          "description": "AT-URI of the sh.tangled.repo.pull record this run belongs to"
 54        }
 55      }
 56    },
 57    "manual": {
 58      "type": "object",
 59      "required": ["sha"],
 60      "properties": {
 61        "sha": {
 62          "type": "string",
 63          "description": "commit SHA the manual run targets",
 64          "minLength": 40,
 65          "maxLength": 40
 66        },
 67        "ref": {
 68          "type": "string",
 69          "description": "optional ref the SHA was resolved from, for display and TANGLED_REF"
 70        },
 71        "sourceRepo": {
 72          "type": "string",
 73          "format": "did",
 74          "description": "Repository DID to check out code and workflow definitions from, if different from the target repo."
 75        },
 76        "inputs": {
 77          "type": "array",
 78          "items": {
 79            "type": "ref",
 80            "ref": "#pair"
 81          }
 82        }
 83      }
 84    },
 85    "schedule": {
 86      "type": "object",
 87      "required": ["sha", "ref", "scheduledAt"],
 88      "properties": {
 89        "sha": {
 90          "type": "string",
 91          "description": "commit SHA the scheduled run targets",
 92          "minLength": 40,
 93          "maxLength": 40
 94        },
 95        "ref": {
 96          "type": "string",
 97          "description": "default branch ref resolved for the scheduled run"
 98        },
 99        "scheduledAt": {
100          "type": "string",
101          "format": "datetime",
102          "description": "UTC minute selected by the cron schedule"
103        }
104      }
105    },
106    "pair": {
107      "type": "object",
108      "required": ["key", "value"],
109      "properties": {
110        "key": {
111          "type": "string"
112        },
113        "value": {
114          "type": "string"
115        }
116      }
117    }
118  }
119}