File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,19 @@ jobs:
8484 # see https://github.com/actions/runner-images/issues/7443.
8585 if : ${{ startsWith(inputs.host-platform, 'win') }}
8686 env :
87- # doesn't seem there's an easy way to avoid hard-coding it?
88- YQ_URL : https://github.com/mikefarah/yq/releases/latest/download/yq_windows_amd64.exe
89- YQ_DIR : yq_latest
87+ YQ_VERSION : v4.52.5
88+ YQ_SHA256 : 47594981f3848a4b4447494adeca9555f908f7cf0a89c4da3fd0243a4631da1c
89+ YQ_DIR : yq
9090 shell : pwsh -command ". '{0}'"
9191 run : |
92+ $yqUrl = "https://github.com/mikefarah/yq/releases/download/${env:YQ_VERSION}/yq_windows_amd64.exe"
9293 mkdir -Force -ErrorAction SilentlyContinue "${env:YQ_DIR}" | Out-Null
93- Invoke-WebRequest -UseBasicParsing -OutFile "${env:YQ_DIR}/yq.exe" -Uri "$env:YQ_URL"
94+ Invoke-WebRequest -UseBasicParsing -OutFile "${env:YQ_DIR}/yq.exe" -Uri "$yqUrl"
95+ $hash = (Get-FileHash -Algorithm SHA256 "${env:YQ_DIR}/yq.exe").Hash.ToLower()
96+ if ($hash -ne $env:YQ_SHA256) {
97+ Write-Error "SHA256 mismatch for yq: expected $env:YQ_SHA256, got $hash"
98+ exit 1
99+ }
94100 ls -l $env:YQ_DIR
95101 echo "$((Get-Location).Path)\\$env:YQ_DIR" >> $env:GITHUB_PATH
96102 $env:Path += ";$((Get-Location).Path)\\$env:YQ_DIR"
You can’t perform that action at this time.
0 commit comments