#!/usr/bin/env bash # Prints the sanitized, collision-resistant cache key for a raw git ref. # Thin CLI wrapper over cache_key() in cache-lib.sh, kept as its own entry # point so a consuming workflow (or an out-of-band cleanup job, e.g. one # reclaiming a deleted branch's directory) can resolve the same key this # action uses without reimplementing the algorithm. Reimplementing it is the # one thing that must never happen: two spellings of the key silently # misclassify every directory on the volume. # # Usage: branch-cache-key.sh "" set -euo pipefail . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/cache-lib.sh" if [ $# -ne 1 ] || [ -z "$1" ]; then echo "::error::branch-cache-key.sh: expected exactly one non-empty argument (the raw ref)" >&2 exit 1 fi cache_key "$1"