Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clients/githubrepo/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@
// Ignore permissions errors if we know the repository is using rulesets, so non-admins can still get a score.
queryData := new(branchData)
if err := handler.graphClient.Query(handler.ctx, queryData, vars); err != nil {
if strings.Contains(err.Error(), "resource not accessible by integration") {
return nil, sce.WithMessage(sce.ErrScorecardInternal, "Branch protection failed.Default token insufficient.Use PAT.")

Check warning on line 315 in clients/githubrepo/branches.go

View check run for this annotation

Codecov / codecov/patch

clients/githubrepo/branches.go#L314-L315

Added lines #L314 - L315 were not covered by tests
}
// always report errors which aren't token permission related
if !isPermissionsError(err) {
return nil, sce.WithMessage(sce.ErrScorecardInternal, fmt.Sprintf("githubv4.Query: %v", err))
Expand Down
Loading