Skip to content

Instantly share code, notes, and snippets.

@Cyberboss
Created January 29, 2018 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cyberboss/383453fb0d4cea313460692ea9aa6eb2 to your computer and use it in GitHub Desktop.
Save Cyberboss/383453fb0d4cea313460692ea9aa6eb2 to your computer and use it in GitHub Desktop.
using Octokit;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
namespace ShutDownEverything
{
static class Program
{
const string APIKey = "HAHAH NO NOT THIS TIME FUCK YOU";
const string RepoOwner = "tgstation";
const string RepoName = "tgstation";
static async Task Main()
{
var client = new GitHubClient(new ProductHeaderValue(Assembly.GetExecutingAssembly().GetName().Name))
{
Credentials = new Credentials(APIKey)
};
var tasks = new List<Task>();
foreach (var I in await client.PullRequest.GetAllForRepository(RepoOwner, RepoName, new PullRequestRequest { State = ItemStateFilter.Open }))
tasks.Add(client.PullRequest.Update(RepoOwner, RepoName, I.Number, new PullRequestUpdate { State = ItemState.Closed }));
await Task.WhenAll(tasks);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment