File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
code/SimpleRemoteGitRepoBackup.Console Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ await Parser.Default.ParseArguments<CommandOptions>(args)
7575 {
7676 var githubLogger = scope . ServiceProvider . GetRequiredService < ILogger < GitHubRepositoryProvider > > ( ) ;
7777
78+ var client = new GitHubClient ( new ProductHeaderValue ( "CodeBackupApp" ) ) ;
79+
7880 // If we don't provide any credentials for GH then we are limited
7981 // in accessing only public repositories and have very low rate limits.
8082 var credentials = string . IsNullOrWhiteSpace ( options . Token )
@@ -85,11 +87,11 @@ await Parser.Default.ParseArguments<CommandOptions>(args)
8587 {
8688 logger . LogWarning ( "⚠️⚠️⚠️ No GitHub Personal Access Token provided. Only public repositories can be accessed, and rate limits will be low." ) ;
8789 }
88-
89- var client = new GitHubClient ( new ProductHeaderValue ( "CodeBackupApp" ) )
90+
91+ if ( credentials != null )
9092 {
91- Credentials = credentials
92- } ;
93+ client . Credentials = credentials ;
94+ }
9395
9496 var fileSystem = new FileSystemWrapper ( ) ;
9597
You can’t perform that action at this time.
0 commit comments