File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
.github/actions/install-zstd Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 88 description : ' zstd version'
99 required : false
1010 default : ' 1.5.7'
11+ checksum :
12+ description : ' zstd checksum'
13+ required : false
14+ default : ' acb4e8111511749dc7a3ebedca9b04190e37a17afeb73f55d4425dbf0b90fad9'
1115
1216runs :
1317 using : composite
@@ -17,10 +21,16 @@ runs:
1721 shell : pwsh
1822 env :
1923 ZSTD_VERSION : ${{ inputs.version }}
24+ ZSTD_CHECKSUM : ${{ inputs.checksum }}
2025 run : |
2126 $url = "https://github.com/facebook/zstd/releases/download/v$env:ZSTD_VERSION/zstd-v$env:ZSTD_VERSION-win64.zip"
2227 $installDir = "$env:RUNNER_TOOL_CACHE\zstd-v$env:ZSTD_VERSION-win64"
2328 Invoke-WebRequest -OutFile "$env:TEMP\zstd.zip" -Uri $url
29+ $checksum = (Get-FileHash "$env:TEMP\zstd.zip" -Algorithm SHA256).Hash.ToLower()
30+ if ($checksum -ne $env:ZSTD_CHECKSUM) {
31+ Write-Error "zstd checksum verification failed. Expected: $env:ZSTD_CHECKSUM, Actual: $checksum"
32+ exit 1
33+ }
2434 Expand-Archive -Path "$env:TEMP\zstd.zip" -DestinationPath $env:RUNNER_TOOL_CACHE -Force
2535 echo "$installDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
2636 & "$installDir\zstd.exe" --version
You can’t perform that action at this time.
0 commit comments