AuditOrg runs a series of checks on a given organization and returns the issues found, execution state for each check run (whether it was successful or yielded in an error), and a generic overall error if audit fails overall
( name string, enableUserPermissionStats bool, )
| 48 | // issues found, execution state for each check run (whether it was successful |
| 49 | // or yielded in an error), and a generic overall error if audit fails overall |
| 50 | func (gs GithubAuditor) AuditOrg( |
| 51 | name string, |
| 52 | enableUserPermissionStats bool, |
| 53 | ) ([]issue.Issue, map[issue.IssueID]error, error) { |
| 54 | ctx := context.Background() |
| 55 | back := &backoff.Backoff{ |
| 56 | Min: 30 * time.Second, |
| 57 | Max: 30 * time.Minute, |
| 58 | Jitter: true, |
| 59 | } |
| 60 | org, err := org.NewOrganization(ctx, gs.client, back, name) |
| 61 | if err != nil { |
| 62 | log.Logger.Error(err) |
| 63 | return nil, nil, err |
| 64 | } |
| 65 | |
| 66 | return org.Audit(ctx, enableUserPermissionStats) |
| 67 | } |