Skip to content

Commit ce00802

Browse files
authored
Use PAT to increase the rate limit in ci pipeline (Azure#19409)
Co-authored-by: wyunchi-ms <[email protected]>
1 parent dafdac4 commit ce00802

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.azure-pipelines/util/analyze-steps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ steps:
4949
command: custom
5050
custom: msbuild
5151
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
52+
env:
53+
OCTOKITPAT: $(OCTOKITPAT)
5254

5355
- task: DotNetCoreCLI@2
5456
displayName: 'Static Analysis'
5557
inputs:
5658
command: custom
5759
custom: msbuild
5860
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
61+
env:
62+
OCTOKITPAT: $(OCTOKITPAT)
5963

6064
- template: publish-artifacts-steps.yml
6165
parameters:

.azure-pipelines/util/build-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ steps:
4949
command: custom
5050
custom: msbuild
5151
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
52+
env:
53+
OCTOKITPAT: $(OCTOKITPAT)
5254

5355
- task: PowerShell@2
5456
displayName: Build-AzPredictor

.azure-pipelines/util/test-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ steps:
3636
command: custom
3737
custom: msbuild
3838
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
39+
env:
40+
OCTOKITPAT: $(OCTOKITPAT)
3941

4042
- powershell: |
4143
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force -SkipPublisherCheck

tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/FilesChangedTask.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,8 @@ public override bool Execute()
100100
try
101101
{
102102
//The variable is set in pipeline: "azure-powershell - powershell-core"
103-
var token = Environment.GetEnvironmentVariable("NOSCOPEPAT_ADXSDKPS");
104103
var client = new GitHubClient(new ProductHeaderValue("Azure"));
105-
if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && !string.IsNullOrEmpty(token))
106-
{
107-
client.Credentials = new Credentials(token);
108-
}
104+
client.Credentials = new Credentials(Environment.GetEnvironmentVariable("OCTOKITPAT"));
109105
var files = client.PullRequest.Files(RepositoryOwner, RepositoryName, int.Parse(PullRequestNumber))
110106
.ConfigureAwait(false).GetAwaiter().GetResult();
111107
if (files == null)

0 commit comments

Comments
 (0)