sh.tangled.pipeline.json

  1{
  2  "lexicon": 1,
  3  "id": "sh.tangled.pipeline",
  4  "needsCbor": true,
  5  "needsType": true,
  6  "defs": {
  7    "main": {
  8      "type": "record",
  9      "key": "tid",
 10      "record": {
 11        "type": "object",
 12        "description": "DEPRECATED: use sh.tangled.ci.pipeline instead",
 13        "required": [
 14          "triggerMetadata",
 15          "workflows"
 16        ],
 17        "properties": {
 18          "triggerMetadata": {
 19            "type": "ref",
 20            "ref": "#triggerMetadata"
 21          },
 22          "workflows": {
 23            "type": "array",
 24            "items": {
 25              "type": "ref",
 26              "ref": "#workflow"
 27            }
 28          }
 29        }
 30      }
 31    },
 32    "triggerMetadata": {
 33      "type": "object",
 34      "required": [
 35        "kind",
 36        "repo"
 37      ],
 38      "properties": {
 39        "kind": {
 40          "type": "string",
 41          "enum": [
 42            "push",
 43            "pull_request",
 44            "manual",
 45            "schedule"
 46          ]
 47        },
 48        "repo": {
 49          "type": "ref",
 50          "ref": "#triggerRepo"
 51        },
 52        "push": {
 53          "type": "ref",
 54          "ref": "#pushTriggerData"
 55        },
 56        "pullRequest": {
 57          "type": "ref",
 58          "ref": "#pullRequestTriggerData"
 59        },
 60        "manual": {
 61          "type": "ref",
 62          "ref": "#manualTriggerData"
 63        },
 64        "schedule": {
 65          "type": "ref",
 66          "ref": "#scheduleTriggerData"
 67        },
 68        "sourceRepo": {
 69          "type": "string",
 70          "format": "did",
 71          "description": "Repository DID that code and workflow definitions are checked out from, when different from repo (e.g. a fork's commit for a fork-based manual trigger). If absent, source uses repo itself."
 72        }
 73      }
 74    },
 75    "triggerRepo": {
 76      "type": "object",
 77      "required": [
 78        "knot",
 79        "did",
 80        "defaultBranch"
 81      ],
 82      "properties": {
 83        "knot": {
 84          "type": "string"
 85        },
 86        "did": {
 87          "type": "string",
 88          "format": "did"
 89        },
 90        "repoDid": {
 91          "type": "string",
 92          "description": "DID of the repo itself",
 93          "format": "did"
 94        },
 95        "repo": {
 96          "type": "string"
 97        },
 98        "defaultBranch": {
 99          "type": "string"
100        }
101      }
102    },
103    "pushTriggerData": {
104      "type": "object",
105      "required": [
106        "ref",
107        "newSha",
108        "oldSha"
109      ],
110      "properties": {
111        "ref": {
112          "type": "string"
113        },
114        "newSha": {
115          "type": "string",
116          "minLength": 40,
117          "maxLength": 40
118        },
119        "oldSha": {
120          "type": "string",
121          "minLength": 40,
122          "maxLength": 40
123        }
124      }
125    },
126    "pullRequestTriggerData": {
127      "type": "object",
128      "required": [
129        "sourceBranch",
130        "targetBranch",
131        "sourceSha"
132      ],
133      "properties": {
134        "action": {
135          "type": "string",
136          "description": "the pull request lifecycle action that produced this trigger",
137          "enum": [
138            "opened",
139            "reopened",
140            "closed",
141            "merged",
142            "synchronize"
143          ]
144        },
145        "sourceBranch": {
146          "type": "string"
147        },
148        "targetBranch": {
149          "type": "string"
150        },
151        "sourceSha": {
152          "type": "string",
153          "minLength": 40,
154          "maxLength": 40
155        },
156        "pull": {
157          "type": "string",
158          "format": "at-uri",
159          "description": "AT-URI of the sh.tangled.repo.pull record this run belongs to"
160        }
161      }
162    },
163    "manualTriggerData": {
164      "type": "object",
165      "required": [
166        "sha"
167      ],
168      "properties": {
169        "sha": {
170          "type": "string",
171          "description": "commit SHA the manual run targets",
172          "minLength": 40,
173          "maxLength": 40
174        },
175        "ref": {
176          "type": "string",
177          "description": "optional ref the SHA was resolved from, for display and TANGLED_REF"
178        },
179        "inputs": {
180          "type": "array",
181          "items": {
182            "type": "ref",
183            "ref": "#pair"
184          }
185        }
186      }
187    },
188    "scheduleTriggerData": {
189      "type": "object",
190      "required": [
191        "sha",
192        "ref",
193        "scheduledAt"
194      ],
195      "properties": {
196        "sha": {
197          "type": "string",
198          "description": "commit SHA the scheduled run targets",
199          "minLength": 40,
200          "maxLength": 40
201        },
202        "ref": {
203          "type": "string",
204          "description": "default branch ref resolved for the scheduled run"
205        },
206        "scheduledAt": {
207          "type": "string",
208          "format": "datetime",
209          "description": "UTC minute selected by the cron schedule"
210        }
211      }
212    },
213    "workflow": {
214      "type": "object",
215      "required": [
216        "name",
217        "engine",
218        "clone",
219        "raw"
220      ],
221      "properties": {
222        "name": {
223          "type": "string"
224        },
225        "engine": {
226          "type": "string"
227        },
228        "runsOn": {
229          "type": "array",
230          "items": {
231            "type": "string"
232          }
233        },
234        "clone": {
235          "type": "ref",
236          "ref": "#cloneOpts"
237        },
238        "raw": {
239          "type": "string"
240        }
241      }
242    },
243    "cloneOpts": {
244      "type": "object",
245      "required": [
246        "skip",
247        "depth",
248        "submodules",
249        "tags"
250      ],
251      "properties": {
252        "skip": {
253          "type": "boolean"
254        },
255        "depth": {
256          "type": "integer"
257        },
258        "submodules": {
259          "type": "boolean"
260        },
261        "tags": {
262          "type": "boolean"
263        }
264      }
265    },
266    "pair": {
267      "type": "object",
268      "required": [
269        "key",
270        "value"
271      ],
272      "properties": {
273        "key": {
274          "type": "string"
275        },
276        "value": {
277          "type": "string"
278        }
279      }
280    }
281  }
282}