Skip to content

Commit

Permalink
Merge pull request #102 from git-for-windows/post-deployment-script-r…
Browse files Browse the repository at this point in the history
…egex-bug

post-deployment-script: fix regex for sha256
  • Loading branch information
dscho authored Nov 26, 2024
2 parents ff214a4 + c47f65f commit 1b40a1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion azure-self-hosted-runners/post-deployment-script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Write-Output "Starting post-deployment script."
try {
[System.Object]$GithubRestData = Invoke-RestMethod -Uri $GitHubUrl -Method Get -Headers $GithubHeaders -TimeoutSec 10 | Select-Object -Property assets, body
[System.Object]$GitHubAsset = $GithubRestData.assets | Where-Object { $_.name -match $GithubExeName }
if ($GithubRestData.body -match "\b${[Regex]::Escape($GitHubAsset.name)}.*?\|.*?([a-zA-Z0-9]{64})" -eq $True) {
$AssetNameEscaped = [Regex]::Escape($GitHubAsset.name)
if ($GithubRestData.body -match "\b${AssetNameEscaped}.*?\|.*?([a-zA-Z0-9]{64})" -eq $True) {
[System.Object]$GitHubGit = [PSCustomObject]@{
DownloadUrl = [string]$GitHubAsset.browser_download_url
Hash = [string]$Matches[1].ToUpper()
Expand Down

0 comments on commit 1b40a1b

Please sign in to comment.