Skip to content

Commit 1b40a1b

Browse files
authored
Merge pull request #102 from git-for-windows/post-deployment-script-regex-bug
post-deployment-script: fix regex for sha256
2 parents ff214a4 + c47f65f commit 1b40a1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

azure-self-hosted-runners/post-deployment-script.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ Write-Output "Starting post-deployment script."
5252
try {
5353
[System.Object]$GithubRestData = Invoke-RestMethod -Uri $GitHubUrl -Method Get -Headers $GithubHeaders -TimeoutSec 10 | Select-Object -Property assets, body
5454
[System.Object]$GitHubAsset = $GithubRestData.assets | Where-Object { $_.name -match $GithubExeName }
55-
if ($GithubRestData.body -match "\b${[Regex]::Escape($GitHubAsset.name)}.*?\|.*?([a-zA-Z0-9]{64})" -eq $True) {
55+
$AssetNameEscaped = [Regex]::Escape($GitHubAsset.name)
56+
if ($GithubRestData.body -match "\b${AssetNameEscaped}.*?\|.*?([a-zA-Z0-9]{64})" -eq $True) {
5657
[System.Object]$GitHubGit = [PSCustomObject]@{
5758
DownloadUrl = [string]$GitHubAsset.browser_download_url
5859
Hash = [string]$Matches[1].ToUpper()

0 commit comments

Comments
 (0)