Skip to content

CICD-112 · Cache a downloaded tool archive safely ​

Encyclopedia · Workflow reuse and caching · All snippets

Previous · CICD-111 · Next · CICD-113

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites trusted checkout and cache/artifact support verified on the chosen Actions runner.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
sha256sum --strict --check tools/tool.tar.gz.sha256
tar -tzf tools/tool.tar.gz > tools/tool.contents

3. How it works ​

The check recomputes hashes for the paths in the trusted manifest and fails on incorrect bytes or malformed entries. The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream.

4. Verify the result ​

Protect the reference hash upstream. A cache hit does not imply integrity.

Validation syntax-validated (Bash parse). Status definitions.