Skip to content

Commit f2cceac

Browse files
committed
Work CI-CD
- Improve listing of PR files using github cli. ***NO_CI***
1 parent ee88e87 commit f2cceac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: azure-pipelines.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ steps:
9999
Write-host "Building from PR"
100100
101101
# get files changed in PR, if this is a PR
102-
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/pulls/$env:System_PullRequest_PullRequestNumber/files" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
102+
# can get max of 100 files using this method (for more requires paging)
103+
$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nanoFramework.IoT.Device/pulls/$env:System_PullRequest_PullRequestNumber/files?per_page=100" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
103104
104105
# filter removed files
105106
$files = $commit.where{$_.status -ne 'removed'}
@@ -129,7 +130,7 @@ steps:
129130
Write-host ""
130131
131132
# pattern to select device folder name
132-
$pattern = '(devices\/)(?<folder>.+)(\/)'
133+
$pattern = '(devices\/)(?<folder>[a-zA-z.]+)(?>\/)'
133134
134135
# filter out the collection
135136
$results = [Regex]::Matches($files1, $pattern)

0 commit comments

Comments
 (0)