fix(plan): correctly parse --test-release-type flag

The --test-release-type flag was essentially broken and ignored, always
creating a prerelease release for test builds. Now it can also produce
draft releases.
This commit is contained in:
2021-07-04 23:27:00 +01:00
parent c0c809a86a
commit fd0ec4d772
2 changed files with 5 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ func planAction(c *cli2.Context, opts *Options) error {
GithubToken: c.String("github-token"),
}
if c.String("test-build-type") == "draft" {
if c.String("test-release-type") == "draft" {
planOpts.TestBuildType = plan.Draft
}

View File

@@ -120,10 +120,12 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) {
plan.Build.Name += ".test." + testName
plan.Release.Title = "Test Builds"
plan.Release.Name = "test-builds"
plan.Release.Prerelease = true
plan.Release.Draft = false
if opts.TestBuildType == Draft {
plan.Release.Prerelease = false
plan.Release.Draft = true
} else {
plan.Release.Prerelease = true
}
index := strings.LastIndex(diskImage, ".")