Reference

On this page

Inputs #

NameDefaultDescription
versionlatestVersion of block to install (v0.1.0, 0.1.0, or latest).
github-token${{ github.token }}Token for API requests and downloads. Also exported as GITHUB_TOKEN for block sync.
install-dir$HOME/.block/binWhere the block binary is installed.
verify-checksumtrueVerify the archive against checksums.txt.
verify-signaturefalseVerify checksums.txt with its cosign bundle. Requires cosign on PATH.
verify-attestationfalseVerify build provenance with gh attestation verify. Requires the gh CLI.
add-to-pathtrueAdd the install directory to PATH for later steps.
block-home~/.local/share/blockThe $BLOCK_HOME directory, exported for later steps.
cachetrueCache $BLOCK_HOME, keyed by block.lock.
working-directory.Directory holding block.toml and block.lock.
syncfalseRun block sync after installing.

Outputs #

NameDescription
versionThe resolved version that was installed.
bin-pathAbsolute path to the installed block binary.
install-dirDirectory the binary was installed into.
block-homeThe $BLOCK_HOME exported for later steps.
cache-hittrue when the toolchain cache was restored exactly. Empty when caching is disabled.

The cache key #

block-<runner os>-<runner arch>-<hash of working-directory/block.lock>

There are no restore-keys. A store restored from a different lockfile would be verified and then mostly discarded, since block installs per version and per artifact digest; re-downloading what actually changed is both simpler and faster. Set cache: "false" when a workflow manages $BLOCK_HOME itself.

Supply-chain checks #

- uses: sigstore/cosign-installer@v3
- uses: nao1215/setup-block@v0
  with:
    verify-signature: "true"
    verify-attestation: "true"

verify-signature checks the cosign bundle published for checksums.txt, which transitively covers every artifact listed there. verify-attestation checks the build provenance GitHub recorded for the archive.

Both are opt-in because each needs a tool on the runner — cosign and gh respectively — and neither replaces the SHA-256 check, which is on by default.

Errors you might see #

MessageMeaning
block does not ship Windows builds…Use a Linux or macOS runner.
failed to download block_…tar.gzThe requested release or platform does not exist.
checksum mismatch for …The download did not match checksums.txt. Nothing is installed.
block.lock not found; run "block lock"sync: "true" ran in a directory without a lockfile. Check working-directory.
block.lock is stale; run "block lock"block.toml changed and the lockfile was not updated. Lock it in a pull request, not in CI.