diff --git a/src/gei/Commands/GenerateScript/GenerateScriptCommandHandler.cs b/src/gei/Commands/GenerateScript/GenerateScriptCommandHandler.cs index fc2f5ec1..8a99a6b2 100644 --- a/src/gei/Commands/GenerateScript/GenerateScriptCommandHandler.cs +++ b/src/gei/Commands/GenerateScript/GenerateScriptCommandHandler.cs @@ -94,14 +94,14 @@ private async Task GenerateSequentialGithubScript(IEnumerable<(string Na content.AppendLine(VALIDATE_GH_PAT); - if (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl)) + if (!useGithubStorage && (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl))) { if (awsBucketName.HasValue() || awsRegion.HasValue()) { content.AppendLine(VALIDATE_AWS_ACCESS_KEY_ID); content.AppendLine(VALIDATE_AWS_SECRET_ACCESS_KEY); } - else if (!useGithubStorage) + else { content.AppendLine(VALIDATE_AZURE_STORAGE_CONNECTION_STRING); } @@ -132,14 +132,14 @@ private async Task GenerateParallelGithubScript(IEnumerable<(string Name content.AppendLine(EXEC_AND_GET_MIGRATION_ID_FUNCTION_BLOCK); content.AppendLine(VALIDATE_GH_PAT); - if (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl)) + if (!useGithubStorage && (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl))) { if (awsBucketName.HasValue() || awsRegion.HasValue()) { content.AppendLine(VALIDATE_AWS_ACCESS_KEY_ID); content.AppendLine(VALIDATE_AWS_SECRET_ACCESS_KEY); } - else if (!useGithubStorage) + else { content.AppendLine(VALIDATE_AZURE_STORAGE_CONNECTION_STRING); } diff --git a/src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs b/src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs index 0392b545..51084c8a 100644 --- a/src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs +++ b/src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs @@ -64,7 +64,16 @@ public async Task Handle(MigrateRepoCommandArgs args) _log.LogInformation("Migrating Repo..."); - var blobCredentialsRequired = await _ghesVersionChecker.AreBlobCredentialsRequired(args.GhesApiUrl); + var blobCredentialsRequired = false; + + if (args.UseGithubStorage) + { + blobCredentialsRequired = true; + } + else + { + blobCredentialsRequired = await _ghesVersionChecker.AreBlobCredentialsRequired(args.GhesApiUrl); + }; if (args.GhesApiUrl.HasValue()) { @@ -396,7 +405,7 @@ private void ValidateGHESOptions(MigrateRepoCommandArgs args, bool cloudCredenti if (args.UseGithubStorage) { - _log.LogWarning("Ignoring --use-github-storage flag because you are running GitHub Enterprise Server (GHES) 3.8.0 or later. The blob storage credentials configured in your GHES Management Console will be used instead."); + _log.LogWarning("Provding the --use-github-storage flag will supersede any credentials you have configured in your GitHub Enterprise Server (GHES) Management Console."); } if (args.KeepArchive)