예제 #1
0
        public PackageHandler(string githubToken, bool log = true)
        {
            _fileLogger = new LoggerConfiguration()
                          .MinimumLevel.Information()
                          .WriteToIf(log, s => s.RollingFile(new JsonFormatter(renderMessage: true), "log.json"))
                          .CreateLogger();

            Github = new GithubWrapper(githubToken);
        }
예제 #2
0
        /// <summary>
        /// Stars package github repository
        /// </summary>
        /// <param name="package"></param>
        /// <param name="githubToken"></param>
        /// <returns></returns>
        public static async Task <bool> StarPackage(PackageReference package, string githubToken)
        {
            if ((package.Metadata?.HasGithub == false && package.Metadata?.HasParsedGithub == false) || string.IsNullOrEmpty(package.Metadata?.GithubUrl))
            {
                throw new ArgumentException("Package must have github url!", nameof(package));
            }

            var github = new GithubWrapper(githubToken);

            return(await github.StarRepo(package.Metadata.GithubUrl));
        }
예제 #3
0
 public IssueService(GithubWrapper client)
 {
     _client = client;
 }
예제 #4
0
 public WebhookService(IProviderFactory providerFactory, IOptions <TriggrConfig> config, GithubWrapper client)
 {
     _providerFactory = providerFactory;
     _config          = config.Value;
     _client          = client;
 }