Beispiel #1
0
        private static GitHubClient CreateClient()
        {
            GitHubClient client = new GitHubClient(new ProductHeaderValue("Bam.GitHub"))
            {
                Credentials = new Credentials(BamProfile.ReadDataFile("github-api-token"))
            };

            return(client);
        }
Beispiel #2
0
        public void ListNewIssuesAndPullRequestsWithinLastEightDays()
        {
            string githubReposListFile = "github-repos.yml";

            RepoListDescriptor repoList = BamProfile.LoadYamlData <RepoListDescriptor>(githubReposListFile);

            foreach (string repo in repoList.Repositories)
            {
                Message.PrintLine("**** {0} ****", ConsoleColor.DarkCyan, repo);
                Repository            repository = _gitHubClient.Repository.Get(repoList.Owner, repo).Result;
                IReadOnlyList <Issue> issues     = _gitHubClient.Issue.GetAllForRepository(repository.Id).Result;
                PrintNewIssues(repo, issues);
                IReadOnlyList <PullRequest> pullRequests = _gitHubClient.PullRequest.GetAllForRepository(repository.Id).Result;
                PrintNewPullRequests(repo, pullRequests);
                Thread.Sleep(300);
            }
        }