public override async Task SynchronizeAsync(OrganizationNameParameter sourceOrganizationNameParameter,
                                                    RepositoryNameParameter repositoryNameParameter,
                                                    OrganizationNameParameter targetOrganizationNameParameter,
                                                    StrictFlagParameter strictFlagParameter)
        {
            Repository sourceRepository = await GitHubClient.Repository.Get(sourceOrganizationNameParameter.Value, repositoryNameParameter.Value);

            Organization organization = await GitHubClient.Organization
                                        .Get(targetOrganizationNameParameter.Value);

            IReadOnlyList <Repository> repositories = await GetRepositoriesAsync(sourceRepository, organization);

            await SynchronizeRepositoriesLabels(strictFlagParameter, sourceRepository, repositories);
        }
        public override async Task SynchronizeAsync(OrganizationNameParameter sourceOrganizationLoginNameParameter,
                                                    RepositoryNameParameter sourceRepositoryNameParameter,
                                                    OrganizationNameParameter targetOrganizationLoginNameParameter,
                                                    RepositoryNameParameter targetRepositoryNameParameter,
                                                    StrictFlagParameter strictFlagParameter)
        {
            if (string.Equals(sourceRepositoryNameParameter.Value, targetRepositoryNameParameter.Value))
            {
                WriteLog($"Synchronization stopped. Repo '{sourceRepositoryNameParameter.Value}' and '{targetRepositoryNameParameter.Value}' have to be different", ConsoleColor.Red);
                return;
            }

            Repository sourceRepository = await GitHubClient.Repository.Get(sourceOrganizationLoginNameParameter.Value, sourceRepositoryNameParameter.Value);

            Repository targetRepository = await GitHubClient.Repository.Get(targetOrganizationLoginNameParameter.Value, targetRepositoryNameParameter.Value);

            await SynchronizeRepositoriesLabels(strictFlagParameter, sourceRepository, new[] { targetRepository });
        }
Ejemplo n.º 3
0
 public abstract Task SynchronizeAsync(OrganizationNameParameter sourceOrganizationLoginNameParameter, RepositoryNameParameter sourceRepositoryNameParameter, OrganizationNameParameter targetOrganizationLoginNameParameter, RepositoryNameParameter targetRepositoryNameParameter, StrictFlagParameter strictFlagParameter);