Skip to content

Commit

Permalink
Handle Unsupported Dependency Update tool check (#3)
Browse files Browse the repository at this point in the history
New functionality added as part of the PR ossf#2125 is not supported for
local repositories. When this code path is hit, it will check if it is
an unsupported error and not fail the Dependency Update tool check.
Fallback to existing behavior for any other type of errors
  • Loading branch information
abhiseksanyal committed Aug 22, 2023
1 parent 32168b4 commit 63b5110
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion checks/raw/dependency_update_tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ func DependencyUpdateTool(c clients.RepoClient) (checker.DependencyUpdateToolDat

commits, err := c.SearchCommits(clients.SearchCommitsOptions{Author: "dependabot[bot]"})
if err != nil {
return checker.DependencyUpdateToolData{}, fmt.Errorf("%w", err)
// Do not fail if client returns an unsupported error
if strings.Contains(err.Error(), clients.ErrUnsupportedFeature.Error()) {
return checker.DependencyUpdateToolData{Tools: tools}, nil
} else {
return checker.DependencyUpdateToolData{}, fmt.Errorf("%w", err)
}
}

for i := range commits {
Expand Down

0 comments on commit 63b5110

Please sign in to comment.