Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Raghav Kaul <[email protected]>
  • Loading branch information
raghavkaul committed Apr 17, 2023
1 parent 7e0af93 commit bc7dd21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions checks/permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ func TestGithubTokenPermissions(t *testing.T) {
filenames: []string{"./testdata/script.sh"},
expected: scut.TestReturn{
Error: nil,
Score: checker.MaxResultScore,
Score: checker.InconclusiveResultScore,
NumberOfWarn: 0,
NumberOfInfo: 2,
NumberOfInfo: 0,
NumberOfDebug: 0,
},
},
Expand Down Expand Up @@ -375,7 +375,7 @@ func TestGithubTokenPermissions(t *testing.T) {

ctrl := gomock.NewController(t)
mockRepo := mockrepo.NewMockRepoClient(ctrl)
mockRepo.EXPECT().GetDefaultBranchName().Return("main", nil)
mockRepo.EXPECT().GetDefaultBranchName().Return("main", nil).AnyTimes()

main := "main"
mockRepo.EXPECT().URI().Return("github.com/ossf/scorecard").AnyTimes()
Expand Down
4 changes: 3 additions & 1 deletion clients/gitlabrepo/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ func (handler *branchesHandler) setup() error {

projectStatusChecks, resp, err := handler.glClient.ExternalStatusChecks.ListProjectStatusChecks(
handler.repourl.project, &gitlab.ListOptions{})
if err != nil && resp.StatusCode != 404 {
if (err != nil || resp.StatusCode != 404) &&
resp.StatusCode != 401 { // 401: permissions. pass token authorization issues silently
handler.errSetup = fmt.Errorf("request for external status checks failed with error %w", err)
return
}

projectApprovalRule, resp, err := handler.glClient.Projects.GetApprovalConfiguration(handler.repourl.project)
Expand Down

0 comments on commit bc7dd21

Please sign in to comment.