diff --git a/tools/bumper/component_commands.go b/tools/bumper/component_commands.go index 9c2b06619..3b28a707f 100644 --- a/tools/bumper/component_commands.go +++ b/tools/bumper/component_commands.go @@ -220,15 +220,16 @@ func (componentOps *gitComponent) getLatestTaggedFromBranch(repo, owner, branch, if err != nil { return "", "", errors.Wrap(err, "Failed to get release tag refs from github client API") } - if resp.NextPage == 0 { - break - } for _, commit := range branchCommits { if commit.GetSHA() == commitShaOfTag { return tagName, commit.GetSHA(), nil } } + + if resp.NextPage == 0 { + break + } } }