File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ if ($msbuild)
1111 $msbuild = join-path $msbuild ' MSBuild\Current\Bin\amd64\MSBuild.exe'
1212}
1313
14- $auth = " basic $ ( [System.Convert ]::ToBase64String([System.Text.Encoding ]::UTF8.GetBytes(" nfbot:${env: MY_GITHUBTOKEN} " ))) )"
14+ # prepare GitHub API headers using token auth
15+ $headers = @ {
16+ Authorization = " token $env: MY_GITHUBTOKEN "
17+ ' User-Agent' = ' azure-pipelines'
18+ Accept = ' application/vnd.github+json'
19+ }
1520
1621if ($env: DEVICE_TO_BUILD -eq " " )
1722{
@@ -30,7 +35,10 @@ if($env:DEVICE_TO_BUILD -eq "")
3035 {
3136 " ##[debug] INFO: iteration $pageCounter " | Write-Host
3237
33- $batch = Invoke-RestMethod - Uri " https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/pulls/$env: System_PullRequest_PullRequestNumber /files?per_page=100&page=$pageCounter " - Header @ {" Authorization" = " $auth " } - ContentType " application/json" - Method GET
38+ $batch = Invoke-RestMethod `
39+ - Uri " https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/pulls/$env: System_PullRequest_PullRequestNumber /files?per_page=100&page=$pageCounter " `
40+ - Headers $headers `
41+ - Method GET
3442
3543 if ($null -eq $commit )
3644 {
@@ -63,7 +71,10 @@ if($env:DEVICE_TO_BUILD -eq "")
6371 {
6472 " ##[command] Get API file change page: $pageCounter " | Write-Host
6573
66- $batch = Invoke-RestMethod - Uri " https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/commits/$env: Build_SourceVersion `?per_page=100&page=$pageCounter " - Header @ {" Authorization" = " $auth " } - ContentType " application/json" - Method GET
74+ $batch = Invoke-RestMethod `
75+ - Uri " https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/commits/$env: Build_SourceVersion `?per_page=100&page=$pageCounter " `
76+ - Headers $headers `
77+ - Method GET
6778
6879 if ($null -eq $commit )
6980 {
You can’t perform that action at this time.
0 commit comments