Ejemplo n.º 1
0
        public async Task CreateLabel(Label label, Octokit.Repository githubRepo)
        {
            var newLabel = new NewLabel(label.Name, label.Color)
            {
                Description = label.Description
            };

            var createdLabel = await GitHubClient.Issue.Labels.Create(githubRepo.Id, newLabel);

            Log($"Label '{createdLabel.Name}' created");
        }
Ejemplo n.º 2
0
        public async Task CreateLabelIfNotExists(Label label, Octokit.Repository githubRepo)
        {
            try
            {
                await GetLabel(label.Name, githubRepo);

                Log($"Label '{label.Name}' already exists");
            }
            catch (NotFoundException)
            {
                await CreateLabel(label, githubRepo);
            }
        }