File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 14
14
//
15
15
namespace Microsoft . WindowsAzure . Build . Tasks
16
16
{
17
+ using System ;
18
+ using System . Collections . Generic ;
19
+ using System . Runtime . InteropServices ;
17
20
using Microsoft . Build . Framework ;
18
21
using Microsoft . Build . Utilities ;
19
22
using Octokit ;
20
- using System . Collections . Generic ;
21
- using System ;
22
23
23
24
/// <summary>
24
25
/// Build task to get all of the files changed in a given PR.
@@ -87,7 +88,13 @@ public override bool Execute()
87
88
List < string > filesChanged = new List < string > ( ) ;
88
89
try
89
90
{
91
+ //The variable is set in pipeline: "azure-powershell - powershell-core"
92
+ var token = Environment . GetEnvironmentVariable ( "NOSCOPEPAT_ADXSDKPS" ) ;
90
93
var client = new GitHubClient ( new ProductHeaderValue ( "Azure" ) ) ;
94
+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) && ! string . IsNullOrEmpty ( token ) )
95
+ {
96
+ client . Credentials = new Credentials ( token ) ;
97
+ }
91
98
var files = client . PullRequest . Files ( RepositoryOwner , RepositoryName , int . Parse ( PullRequestNumber ) )
92
99
. ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
93
100
if ( files == null )
You can’t perform that action at this time.
0 commit comments