Last active
August 29, 2015 14:04
-
-
Save adamralph/0b5d1cd8efd7d5c400cf to your computer and use it in GitHub Desktop.
Create release notes from GitHub issues with power of scriptcs and Octokit!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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