Skip to content

Commit 7c7c2b3

Browse files
committed
Merge branch 'release/0.4.3' into master
2 parents b8418a0 + 459b9b8 commit 7c7c2b3

File tree

3 files changed

+6
-64
lines changed

3 files changed

+6
-64
lines changed

Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ See the Project Site for documentation and an overview of the whole ecosystem of
1919
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Recipe.git"/>
2020
<copyright>Copyright © Pascal Berger</copyright>
2121
<tags>Build Cake Cake.Issues Recipe</tags>
22-
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.4.2</releaseNotes>
22+
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.4.3</releaseNotes>
2323
</metadata>
2424
</package>

Cake.Issues.Recipe/Content/addins.cake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
#addin nuget:?package=Cake.Issues.PullRequests&version=0.9.0
1414
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version=0.9.0
1515
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version=0.9.1
16+
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version=0.9.0
1617
#addin nuget:?package=Cake.AzureDevOps&version=0.5.0

Cake.Issues.Recipe/Content/tasks/buildservers/GitHubActionsBuildServer.cake

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,10 @@ public class GitHubActionsBuildServer : BaseBuildServer
6767
throw new ArgumentNullException(nameof(data));
6868
}
6969

70-
// Group annotations by provider type and run
71-
var groupedIssues =
72-
from issue in data.Issues
73-
group issue by new { issue.ProviderType, issue.Run };
74-
75-
foreach (var group in groupedIssues)
76-
{
77-
var groupName = group.First().ProviderName;
78-
79-
if (!string.IsNullOrWhiteSpace(group.Key.Run))
80-
{
81-
groupName += " - " + group.Key.Run;
82-
}
83-
84-
context.Information($"::group::{groupName}");
85-
86-
foreach (var issue in group.OrderByDescending(x => x.Priority))
87-
{
88-
// Commands don't support line breaks, therefore we only use the first line of the message.
89-
var message =
90-
issue.MessageText
91-
.Split(new[] {'\n'}, StringSplitOptions.RemoveEmptyEntries)
92-
.FirstOrDefault()
93-
?.Trim();
94-
95-
var rootDirectoryPath =
96-
data.RepositoryRootDirectory.GetRelativePath(data.BuildRootDirectory);
97-
98-
context.Information($"::warning {FormatWarningOptions(rootDirectoryPath, issue.AffectedFileRelativePath, issue.Line, issue.Column)}::{message}");
99-
}
100-
101-
context.Information($"::endgroup::{groupName}");
102-
}
70+
context.ReportIssuesToPullRequest(
71+
data.Issues,
72+
context.GitHubActionsBuilds(),
73+
data.BuildRootDirectory);
10374
}
10475

10576
/// <inheritdoc />
@@ -136,34 +107,4 @@ public class GitHubActionsBuildServer : BaseBuildServer
136107

137108
// Publishing artifacts is currently not supported for GitHub Actions.
138109
}
139-
140-
/// <summary>
141-
/// Formats the options for the warning service message.
142-
/// </summary>
143-
/// <param name="rootDirectoryPath">The root path of the file, relative to the repository root.</param>
144-
/// <param name="filePath">The file path relative to the project root.</param>
145-
/// <param name="line">The line where the issue ocurred.</param>
146-
/// <param name="column">The column where the issue ocurred.</param>
147-
/// <returns>Formatted options string for the warning service message.</returns>
148-
private static string FormatWarningOptions(DirectoryPath rootDirectoryPath, FilePath filePath, int? line, int? column)
149-
{
150-
var result = new List<string>();
151-
152-
if (filePath != null)
153-
{
154-
result.Add($"file={rootDirectoryPath.CombineWithFilePath(filePath)}");
155-
}
156-
157-
if (line.HasValue)
158-
{
159-
result.Add($"line={line.Value}");
160-
}
161-
162-
if (column.HasValue)
163-
{
164-
result.Add($"col={column}");
165-
}
166-
167-
return string.Join(",", result);
168-
}
169110
}

0 commit comments

Comments
 (0)