Beispiel #1
0
        /// <summary>
        /// Initializes the release creator.
        /// <para>
        /// The target GitHub repository is determined by the remotes of the local
        /// repository found in <paramref name="repositoryRootDirectory"/>.
        /// </para>
        /// </summary>
        /// <param name="repositoryRootDirectory">The root directory of the local git repository.</param>
        /// <param name="githubToken">A token used for GitHub API authentication.</param>
        public Releaser(DirectoryInfo repositoryRootDirectory, string githubToken)
        {
            using var localRepository = new LocalGitRepository(repositoryRootDirectory.FullName);

            _gitHubApi = new GitHubApi(
                GitHubRepository.FindByRemotes(localRepository.Remotes),
                githubToken);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the release notest creator.
        /// </summary>
        /// <param name="repositoryRootDirectory">The root directory of the local git repository.</param>
        /// <param name="githubToken">A token used for GitHub API authentication.</param>
        /// <param name="configuration">The configuration to use.</param>
        public ReleaseNotesCreator(
            DirectoryInfo repositoryRootDirectory,
            string githubToken,
            ReleaseNotesConfiguration configuration)
        {
            _localRepository  = new LocalGitRepository(repositoryRootDirectory.FullName);
            _gitHubRepository = GitHubRepository.FindByRemotes(_localRepository.Remotes);
            _gitHubApi        = new GitHubApi(_gitHubRepository, githubToken);
            _configuration    = configuration;

            _configuration.EnsureValid();
        }