CICD-105 · Compute a cache key with a namespace bump
Encyclopedia · Workflow reuse and caching · All snippets
Previous · CICD-104 · Next · CICD-106
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.
- Parameters
GITHUB_OUTPUT.
2. Copy the snippet
bash
printf 'key=v2-%s-%s\n' "$(uname -m)" "$(sha256sum uv.lock | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"3. How it works
The command records the content hash of the given output. Transfer the manifest with integrity and verify it at the consumer.
4. Verify the result
Bump the namespace when cache contents or producer toolchain changes.
Validation syntax-validated (Bash parse). Status definitions.