Skip to content

Commit

Permalink
Fix logic for when ddraft release is created
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Oct 8, 2024
1 parent 2ebe31d commit ba87b80
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions recipe/publishing.cake
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,17 @@ public static class PackageReleaseManager

private const string DRAFT_RELEASE_ERROR =
"A direct call to CreateDraftRelease is permitted only:\r\n" +
" * On a release branch (release-x.x.x)\r\n" +
" * On the main branch tagged for a production release\r\n" +
" * On a release branch (release-x.x.x) OR\r\n" +
" * Using option --packageVersion to specify a release version";

public static void CreateDraftRelease()
{
string releaseVersion =
CommandLineOptions.PackageVersion.Exists ? CommandLineOptions.PackageVersion.Value :
BuildSettings.IsReleaseBranch ? BuildSettings.BuildVersion.BranchName.Substring(8) :
BuildSettings.IsProductionRelease ? BuildSettings.PackageVersion : null;
CommandLineOptions.PackageVersion.Exists
? CommandLineOptions.PackageVersion.Value
: BuildSettings.IsReleaseBranch
? BuildSettings.BuildVersion.BranchName.Substring(8)
: null;

if (releaseVersion != null)
{
Expand Down

0 comments on commit ba87b80

Please sign in to comment.