feat: added support for providing optional checksums for ZIP validation (#107)

Signed-off-by: Kim <kim.peter.wagner@gmail.com>
This commit is contained in:
Kim Wagner authored and GitHub committed 2026-04-13 16:46:38 -03:00
1 parent 03a9076efe
commit 4bcfe8cded
6 files changed
+153 -7

No files matched your search

+12
View File
@@ -76,6 +76,17 @@ steps:
cache: true
```
Validation can be enabled to check the downloaded OpenTofu CLI SHA256 hash against a newline-delimited list of checksums:
```yaml
steps:
- uses: opentofu/setup-opentofu@v2
with:
checksums: |
933b060ab1cf05b106e94af1d370fd14b3006a6845495a67c68734269cc705ad
d3d29f51e75a701fc7cf67c0644a8c883a85f36cf1621461988baffd88e7f361
```
Subsequent steps can access outputs when the wrapper script is installed:
```yaml
@@ -275,6 +286,7 @@ The action supports the following inputs:
named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`.
- `cache` - (optional) Whether to use GitHub Actions tool-cache to store and reuse downloaded OpenTofu binaries. Defaults to `false`.
- `github_token` - (optional) Override the GitHub token read from the environment variable. Defaults to the value of the `GITHUB_TOKEN` environment variable unless running on Forgejo or Gitea.
- `checksums` - (optional) A newline-delimited list of valid checksums (SHA256) for the downloaded OpenTofu CLI ZIP. When set, the action will verify the ZIP matches one of the checksums before proceeding. Defaults to `[]`
## Outputs