cleanup method

Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
Meredith Lancaster 2024-03-14 21:33:26 -06:00
parent 8177c6c473
commit 79fa437969

View file

@ -55,12 +55,6 @@ type AttestationDetail struct {
WorkflowID string `json:"workflowId"`
}
// AttestationDetail#Slice returns the fields as string slice in the following order:
// RepositoryName, RepositoryID, OrgName, OrgID, WorkflowID
func (d AttestationDetail) Slice() []string {
return []string{d.RepositoryName, d.RepositoryID, d.OrgName, d.OrgID, d.WorkflowID}
}
func getOrgAndRepo(repoURL string) (string, string, error) {
after, found := strings.CutPrefix(repoURL, "https://github.com/")
if !found {
@ -115,7 +109,7 @@ func getDetailsAsSlice(results []*verification.AttestationProcessingResult) ([][
if err != nil {
return nil, fmt.Errorf("failed to get attestation detail: %w", err)
}
details[i] = detail.Slice()
details[i] = []string{detail.RepositoryName, detail.RepositoryID, detail.OrgName, detail.OrgID, detail.WorkflowID}
}
return details, nil
}