Skip to content

Commit 78fd60e

Browse files
committed
Work CI-CD
- Add back condition to test with preview nanoCLR.
1 parent 10ee428 commit 78fd60e

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

azure-pipelines.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)