File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,27 @@ jobs:
6868 if($env:System_PullRequest_PullRequestNumber -ne $null)
6969 {
7070 # PR build
71- Write-Host "##[command] **This is a PR build**"
71+ # compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
72+ # 'encoded token' is the Base64 of the string "nfbot:personal-token"
73+ $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
74+
75+ # find PR
76+ "Getting PR #$env:System_PullRequest_PullRequestNumber details..." | Write-Host -ForegroundColor White -NoNewline
77+ $pr = Invoke-WebRequest "https://api.github.com/repos/$env:Build_Repository_Name/pulls/$env:System_PullRequest_PullRequestNumber" | ConvertFrom-Json
78+
79+ if($($pr.number) -eq "$env:System_PullRequest_PullRequestNumber")
80+ {
81+ 'OK' | Write-Host -ForegroundColor Green
82+ }
83+
84+ # grab PR commit message
85+ $prCommitMessage = $($pr.body)
86+
87+ # debug output
88+ echo "=====`r`n$($prCommitMessage)`r`n====="
7289
73- $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/metadata-processor/commits/$(Build.SourceVersion)" -ContentType "application/json" -Method GET
74-
7590 # check if should download nanoCLR to run unit tests
76- if($commit.commit.message -like "*[use nanoclr preview]* ")
91+ if($prCommitMessage -match "\[tested against nanoclr buildId (\d+)\] ")
7792 {
7893 Write-Host "##[command] **Download preview nanoCLR for unit tests**"
7994 $downloadPreview = $true
You can’t perform that action at this time.
0 commit comments