Skip to content

Commit

Permalink
(GitToolsGH-495) Allow milestones without issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jul 30, 2024
1 parent f753585 commit 42c75b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/GitReleaseManager.Core/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public Config()
ShaSectionHeading = "SHA256 Hashes of the release artifacts",
ShaSectionLineFormat = "- `{1}\t{0}`",
AllowUpdateToPublishedRelease = false,
AllowMilestonesWithoutIssues = false,
};

Export = new ExportConfig
Expand Down
3 changes: 3 additions & 0 deletions src/GitReleaseManager.Core/Configuration/CreateConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ public class CreateConfig

[YamlMember(Alias = "allow-update-to-published")]
public bool AllowUpdateToPublishedRelease { get; set; }

[YamlMember(Alias = "allow-milestone-without-issues")]
public bool AllowMilestonesWithoutIssues { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public async Task<string> BuildReleaseNotesAsync(string user, string repository,

var numberOfCommits = await _vcsProvider.GetCommitsCountAsync(_user, _repository, @base, head).ConfigureAwait(false);

if (issues.Count == 0)
if (issues.Count == 0 && !_configuration.Create.AllowMilestonesWithoutIssues)
{
var logMessage = string.Format(CultureInfo.CurrentCulture, "No closed issues have been found for milestone {0}, or all assigned issues are meant to be excluded from release notes, aborting release creation.", _milestoneTitle);
throw new InvalidOperationException(logMessage);
Expand Down

0 comments on commit 42c75b7

Please sign in to comment.