Skip to content

Commit ef5383e

Browse files
committed
Merge branch 'hotfix/0.10.2'
* hotfix/0.10.2: (maint) Override Twitter and Gitter messages (build) Add override for GitHub Token Variable (GH-199) Fixed incorrect argument being passed to octokit
2 parents 025afe1 + 050ee00 commit ef5383e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Source/GitReleaseManager/GitHubProvider.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public async Task CloseMilestone(string owner, string repository, string milesto
303303

304304
if (_configuration.Close.IssueComments)
305305
{
306-
await AddIssueCommentsAsync(owner, repository, milestoneTitle).ConfigureAwait(false);
306+
await AddIssueCommentsAsync(owner, repository, milestone).ConfigureAwait(false);
307307
}
308308
}
309309

@@ -411,11 +411,11 @@ private static string ComputeSha256Hash(string asset)
411411
}
412412
}
413413

414-
private async Task AddIssueCommentsAsync(string owner, string repository, string milestone)
414+
private async Task AddIssueCommentsAsync(string owner, string repository, Octokit.Milestone milestone)
415415
{
416416
const string detectionComment = "<!-- GitReleaseManager release comment -->";
417-
var issueComment = detectionComment + "\n" + _configuration.Close.IssueCommentFormat.ReplaceTemplate(new { owner, repository, Milestone = milestone });
418-
var issues = await GetIssuesFromMilestoneAsync(owner, repository, milestone).ConfigureAwait(false);
417+
var issueComment = detectionComment + "\n" + _configuration.Close.IssueCommentFormat.ReplaceTemplate(new { owner, repository, Milestone = milestone.Title });
418+
var issues = await GetIssuesFromMilestoneAsync(owner, repository, milestone.Number).ConfigureAwait(false);
419419

420420
foreach (var issue in issues)
421421
{
@@ -472,12 +472,12 @@ private async Task<Release> CreateReleaseFromInputFileInternal(string owner, str
472472
return _mapper.Map<Octokit.Release, Release>(release);
473473
}
474474

475-
private Task<IReadOnlyList<Octokit.Issue>> GetIssuesFromMilestoneAsync(string owner, string repository, string milestone, ItemStateFilter state = ItemStateFilter.Closed)
475+
private Task<IReadOnlyList<Octokit.Issue>> GetIssuesFromMilestoneAsync(string owner, string repository, int milestoneNumber, ItemStateFilter state = ItemStateFilter.Closed)
476476
{
477-
_logger.Verbose("Finding issues with milestone: '{Milestone}", milestone);
477+
_logger.Verbose("Finding issues with milestone: '{Milestone}", milestoneNumber);
478478
return _gitHubClient.Issue.GetAllForRepository(owner, repository, new RepositoryIssueRequest
479479
{
480-
Milestone = milestone,
480+
Milestone = milestoneNumber.ToString(),
481481
State = state,
482482
});
483483
}

recipe.cake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&version=2.0.0-unstable0023&prerelease
22

33
Environment.SetVariableNames(githubUserNameVariable: "GITTOOLS_GITHUB_USERNAME",
4-
githubPasswordVariable: "GITTOOLS_GITHUB_PASSWORD");
4+
githubPasswordVariable: "GITTOOLS_GITHUB_PASSWORD",
5+
githubTokenVariable: "GITTOOLS_GITHUB_TOKEN");
56

67
BuildParameters.SetParameters(context: Context,
78
buildSystem: BuildSystem,
@@ -13,7 +14,9 @@ BuildParameters.SetParameters(context: Context,
1314
shouldRunGitVersion: true,
1415
shouldRunDotNetCorePack: true,
1516
shouldRunIntegrationTests: true,
16-
integrationTestScriptPath: "./tests/integration/tests.cake");
17+
integrationTestScriptPath: "./tests/integration/tests.cake",
18+
twitterMessage: "A new version of GitReleaseManager has just been released. Get it from Chocolatey, NuGet, or as a .Net Global Tool.",
19+
gitterMessage: "@/all A new version of GitReleaseManager has just been released. Get it from Chocolatey, NuGet, or as a .Net Global Tool.");
1720

1821
BuildParameters.PackageSources.Add(new PackageSourceData(Context, "GPR", "https://nuget.pkg.github.com/GitTools/index.json", FeedType.NuGet, false));
1922

0 commit comments

Comments
 (0)