feat: verify Helm downloads and support fallback mirrors (#315)
* feat: verify Helm downloads and support fallback mirrors * fix: strengthen Helm download fallback * docs: align mirror example with Helm fallback * fix: preserve custom mirror checksum compatibility * fix: warn for missing checksums in auto mode
This commit is contained in:
@@ -42,6 +42,31 @@ If both `version` and `version-file` are set, an explicitly requested `version`
|
||||
>
|
||||
> If you rely on a certain version, you should explicitly request that version instead of `latest`.
|
||||
|
||||
Freshly downloaded Helm archives are verified against the SHA-256 checksum published beside the archive before extraction. With the default `checksum-policy: auto`, the action verifies a matching checksum when one is available as a bare 64-character hexadecimal digest at `<archive-url>.sha256`; when the checksum is not found, the action warns and continues downloading. Existing tool-cache entries continue to be reused without downloading or re-verifying the archive.
|
||||
|
||||
Set `checksum-policy` to control this behavior:
|
||||
|
||||
- `auto` (default): verify checksums when available and warn when they are absent.
|
||||
- `required`: require a valid matching checksum from every download location.
|
||||
- `if-available`: explicitly select the same verify-or-warn behavior as `auto`.
|
||||
- `disabled`: skip checksum verification and emit a warning.
|
||||
|
||||
Malformed or mismatched checksums always fail unless verification is explicitly `disabled`. In `if-available` and `auto` modes, only a checksum response of HTTP 404 or 410 is treated as absent; other download errors fail closed.
|
||||
|
||||
Because each checksum is retrieved from the same mirror as its archive, verification detects corruption or an incomplete mirror sync; it does not protect against a mirror that has been compromised together with its checksum files.
|
||||
|
||||
An optional fallback mirror can be used when version resolution, archive download, or checksum verification fails against the primary location:
|
||||
|
||||
```yaml
|
||||
- uses: azure/setup-helm@v5
|
||||
with:
|
||||
version: 'v4.3.1'
|
||||
downloadBaseURL: 'https://primary.example/helm'
|
||||
downloadBaseURLFallback: 'https://fallback.example/helm'
|
||||
```
|
||||
|
||||
The fallback archive follows the same checksum policy as the primary mirror. This capability follows the use case proposed by @mvtavares in [#227](https://github.com/Azure/setup-helm/pull/227).
|
||||
|
||||
The cached helm binary path is prepended to the PATH environment variable as well as stored in the helm-path output variable.
|
||||
Refer to the action metadata file for details about all the inputs https://github.com/Azure/setup-helm/blob/master/action.yml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user