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 8
8
description : ' zstd version'
9
9
required : false
10
10
default : ' 1.5.7'
11
+ checksum :
12
+ description : ' zstd checksum'
13
+ required : false
14
+ default : ' acb4e8111511749dc7a3ebedca9b04190e37a17afeb73f55d4425dbf0b90fad9'
11
15
12
16
runs :
13
17
using : composite
@@ -17,10 +21,16 @@ runs:
17
21
shell : pwsh
18
22
env :
19
23
ZSTD_VERSION : ${{ inputs.version }}
24
+ ZSTD_CHECKSUM : ${{ inputs.checksum }}
20
25
run : |
21
26
$url = "https://github.com/facebook/zstd/releases/download/v$env:ZSTD_VERSION/zstd-v$env:ZSTD_VERSION-win64.zip"
22
27
$installDir = "$env:RUNNER_TOOL_CACHE\zstd-v$env:ZSTD_VERSION-win64"
23
28
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
+ }
24
34
Expand-Archive -Path "$env:TEMP\zstd.zip" -DestinationPath $env:RUNNER_TOOL_CACHE -Force
25
35
echo "$installDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
26
36
& "$installDir\zstd.exe" --version
You can’t perform that action at this time.
0 commit comments