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 {
|
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
|
upToLatest := false
|
||||||
|
@@ -113,22 +113,27 @@ func (g *gitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return []*gitlab.Tag{}, err
|
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 {
|
if opt.Page >= res.TotalPages {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foundTag := false
|
||||||
for i, tag := range tags {
|
for i, tag := range tags {
|
||||||
if tag.Name == tag_name {
|
if tag.Name == tag_name {
|
||||||
allTags = append(allTags, tags[:i]...)
|
allTags = append(allTags, tags[:i+1]...)
|
||||||
|
foundTag = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if foundTag {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
opt.Page = res.NextPage
|
opt.Page = res.NextPage
|
||||||
allTags = append(allTags, tags...)
|
allTags = append(allTags, tags...)
|
||||||
}
|
}
|
||||||
|
//fmt.Printf("%+v\n", allTags)
|
||||||
|
|
||||||
return allTags, nil
|
return allTags, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user