(tenant, repoURL string)
| 55 | } |
| 56 | |
| 57 | func getOrgAndRepo(tenant, repoURL string) (string, string, error) { |
| 58 | var after string |
| 59 | var found bool |
| 60 | if tenant == "" { |
| 61 | after, found = strings.CutPrefix(repoURL, "https://github.com/") |
| 62 | if !found { |
| 63 | return "", "", fmt.Errorf("failed to get org and repo from %s", repoURL) |
| 64 | } |
| 65 | } else { |
| 66 | after, found = strings.CutPrefix(repoURL, |
| 67 | fmt.Sprintf("https://%s.ghe.com/", tenant)) |
| 68 | if !found { |
| 69 | return "", "", fmt.Errorf("failed to get org and repo from %s", repoURL) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | parts := strings.Split(after, "/") |
| 74 | return parts[0], parts[1], nil |
| 75 | } |
| 76 | |
| 77 | func getAttestationDetail(tenant string, attr api.Attestation) (AttestationDetail, error) { |
| 78 | envelope, err := attr.Bundle.Envelope() |
searching dependent graphs…