Fix check command bugs
This commit is contained in:
@@ -80,7 +80,11 @@ func (c *CheckCommand) Run(request CheckRequest) ([]Version, error) {
|
||||
}
|
||||
|
||||
if latestTag.Name == request.Version.Tag {
|
||||
return []Version{}, nil
|
||||
// GitHub release resource returns empty array:
|
||||
// https://github.com/concourse/github-release-resource/blob/master/check_command.go#L87
|
||||
// but documentation says to return current item?
|
||||
// https://concourse-ci.org/implementing-resources.html#section_resource-check
|
||||
return []Version{Version{Tag: latestTag.Name}}, nil
|
||||
}
|
||||
|
||||
upToLatest := false
|
||||
|
@@ -113,22 +113,27 @@ func (g *gitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) {
|
||||
if err != nil {
|
||||
return []*gitlab.Tag{}, err
|
||||
}
|
||||
fmt.Printf("listing tags until %s, page %d out of %d\n", tag_name, opt.Page, res.TotalPages)
|
||||
|
||||
if opt.Page >= res.TotalPages {
|
||||
break
|
||||
}
|
||||
|
||||
foundTag := false
|
||||
for i, tag := range tags {
|
||||
if tag.Name == tag_name {
|
||||
allTags = append(allTags, tags[:i]...)
|
||||
allTags = append(allTags, tags[:i+1]...)
|
||||
foundTag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if foundTag {
|
||||
break
|
||||
}
|
||||
|
||||
opt.Page = res.NextPage
|
||||
allTags = append(allTags, tags...)
|
||||
}
|
||||
//fmt.Printf("%+v\n", allTags)
|
||||
|
||||
return allTags, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user