Skip to content

Instantly share code, notes, and snippets.

@adamralph adamralph/notes.csx
Last active Aug 29, 2015

Embed
What would you like to do?
Create release notes from GitHub issues with power of scriptcs and Octokit!
var owner = "scriptcs";
var repo = "scriptcs";
var milestone = "v0.10";
var labels = new Dictionary<string, string>{ { "feature", "New" }, { "bug", "Fixed" } };
var username = "adamralph";
var oAuthToken = "secret";
var client = Require<OctokitPack>().CreateWithOAuth("ScriptCs.ReleaseNotesScript", username, oAuthToken);
var issues = client.Issue.GetForRepository(owner, repo, new RepositoryIssueRequest { State = ItemState.Closed, }).Result;
foreach (var issue in issues
.Where(issue => issue.Milestone != null && issue.Milestone.Title == milestone && issue.Labels.Any(label => labels.Keys.Contains(label.Name)))
.Select(issue => new { Number = issue.Number, Title = issue.Title, Label = issue.Labels.First(label => labels.Keys.Contains(label.Name)) })
.OrderBy(issue => issue.Label.Name))
{
Console.WriteLine("**{0}:** {1} - #{2}", labels[issue.Label.Name], issue.Title, issue.Number);
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Octokit" version="0.1.8" targetFramework="net45" />
<package id="ScriptCs.Contracts" version="0.8.1" targetFramework="net45" />
<package id="ScriptCs.Octokit" version="0.2.1" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.