Skip to content
This repository was archived by the owner on Sep 29, 2020. It is now read-only.

Commit 2f15477

Browse files
committed
bin/conch| when looking at github releases, skip prereleases
(cherry picked from commit a9724fc)
1 parent 0ad9598 commit 2f15477

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

pkg/util/github.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ const GhRepo = "conch-shell"
2222

2323
// GithubRelease represents a 'release' for a Github project
2424
type GithubRelease struct {
25-
URL string `json:"html_url"`
26-
TagName string `json:"tag_name"`
27-
SemVer semver.Version `json:"-"` // Will be set to 0.0.0 if no releases are found
28-
Body string `json:"body"`
29-
Name string `json:"name"`
30-
Assets []GithubAsset `json:"assets"`
31-
Upgrade bool `json:"-"`
25+
URL string `json:"html_url"`
26+
TagName string `json:"tag_name"`
27+
SemVer semver.Version `json:"-"` // Will be set to 0.0.0 if no releases are found
28+
Body string `json:"body"`
29+
Name string `json:"name"`
30+
Assets []GithubAsset `json:"assets"`
31+
PreRelease bool `json:"prerelease"`
32+
Upgrade bool `json:"-"`
3233
}
3334

3435
type GithubReleases []GithubRelease
@@ -95,6 +96,9 @@ func LatestGithubRelease() (gh GithubRelease, err error) {
9596
sort.Sort(releases)
9697

9798
for _, r := range releases {
99+
if r.PreRelease {
100+
continue
101+
}
98102
if r.TagName == "" {
99103
continue
100104
}
@@ -135,6 +139,9 @@ func GithubReleasesSince(start semver.Version) GithubReleases {
135139
sort.Sort(releases)
136140

137141
for _, r := range releases {
142+
if r.PreRelease {
143+
continue
144+
}
138145
if r.TagName == "" {
139146
continue
140147
}

0 commit comments

Comments
 (0)