Skip to content

Commit beac60e

Browse files
author
Jake Ginnivan
committed
Capture release notes output when it fails
1 parent 3c2459c commit beac60e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build.cake

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,23 @@ Task("Create-Release-Notes")
128128

129129
if(!string.IsNullOrWhiteSpace(githubToken))
130130
{
131+
IEnumerable<string> redirectedOutput;
131132
var releaseNotesExitCode = StartProcess(
132133
@"tools\GitReleaseNotes\tools\gitreleasenotes.exe",
133-
new ProcessSettings { Arguments = ". /o build/releasenotes.md /repoToken " + githubToken });
134+
new ProcessSettings {
135+
Arguments = ". /o build/releasenotes.md /repoToken " + githubToken,
136+
RedirectStandardOutput = true
137+
},
138+
out redirectedOutput);
139+
134140
if (!System.IO.File.Exists("./build/releasenotes.md") || string.IsNullOrEmpty(System.IO.File.ReadAllText("./build/releasenotes.md"))) {
135141
System.IO.File.WriteAllText("./build/releasenotes.md", "No issues closed since last release");
136142
}
137143

138-
if (releaseNotesExitCode != 0) throw new Exception("Failed to generate release notes");
144+
if (releaseNotesExitCode != 0) {
145+
throw new Exception("Failed to generate release notes:" +
146+
string.Join("\n", redirectedOutput));
147+
}
139148
}
140149
else
141150
{

0 commit comments

Comments
 (0)