CheckType refuses an artifact whose type this version of gh doesn't know. A new type can need handling gh doesn't have, so commands whose behavior depends on the type refuse it instead of guessing. Commands that work the same for every type, such as list, don't call it.
(a client.Artifact)
| 280 | // depends on the type refuse it instead of guessing. Commands that work the |
| 281 | // same for every type, such as list, don't call it. |
| 282 | func CheckType(a client.Artifact) error { |
| 283 | switch a.Type { |
| 284 | case client.TypeGeneric, client.TypePlan, client.TypeLink, client.TypeEmbeddedHTML: |
| 285 | return nil |
| 286 | } |
| 287 | return fmt.Errorf("artifact %d has type %q, which this version of gh doesn't support; upgrade gh", a.Number, a.Type) |
| 288 | } |
| 289 | |
| 290 | // SupportsAttachments reports whether an artifact of type artifactType can |
| 291 | // take --attach files. Attachments go in Markdown, which only generic and plan |