[ci]Fix precheck getting commit id in the fallback (#29849)

This commit is contained in:
Jaime Bernardo 2023-11-14 17:50:23 +00:00 committed by GitHub
parent 887d475560
commit 9265136a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ jobs:
}
catch {
# Fall back to the latest commit otherwise.
$commit = "$(system.pullRequest.sourceCommitId)";
$commit = "$(build.sourceVersion)";
$gitHubCommit = Invoke-RestMethod -Method Get "https://api.github.com/repos/microsoft/PowerToys/commits/$commit"
if(([array]($githubCommit.files.filename) -notmatch ".md|.txt").Length -eq 0) {
Write-Host '##vso[task.setvariable variable=skipBuild;isOutput=true]Yes'