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); }
/// <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)); }
public IssueService(GithubWrapper client) { _client = client; }
public WebhookService(IProviderFactory providerFactory, IOptions <TriggrConfig> config, GithubWrapper client) { _providerFactory = providerFactory; _config = config.Value; _client = client; }